Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OSError when piping output of rf_logs.py #33

Merged
merged 4 commits into from Mar 13, 2020

Conversation

billdodd
Copy link
Contributor

Fix OSError when piping the output of rf_logs.py as described in issue #32.

Fixes #32

finally:
redfish_obj.logout()
sys.stderr.close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be brought into the lower level print routine? I'd rather not create a burden on callers doing this since the "redfish_utilities" folder is supposed to be treated as a library others might use.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the catch of BrokenPipeError to print_log_entries(). But I left the sys.stderr.close() here because that seemed to be the only way to eliminate this extraneous message when piping to head:

Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
BrokenPipeError: [Errno 32] Broken pipe

@mraineri mraineri merged commit 3820743 into DMTF:master Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OSError when piping output from rf_logs.py
2 participants