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

test for stderr before printing #212

Merged
merged 4 commits into from Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to
singularity on pypi), and the versions here will coincide with these releases.

## [master](https://github.com/singularityhub/singularity-cli/tree/master)
- added check to enbsure stderr exists upon a non-zero return code when streaming (0.3.2)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- added check to enbsure stderr exists upon a non-zero return code when streaming (0.3.2)
- added check to enbsure stderr exists upon a non-zero return code when streaming (0.3.11)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ha, yes. Ok. Fixed this as well :P

- exposed the stream type option, and ability to capture both stdout and stderr when stream=True (0.3.1)
- dropping support for Singularity 2.x (0.3.0)
- add comment out of STOPSIGNAL (0.2.14)
Expand Down
5 changes: 4 additions & 1 deletion spython/utils/terminal.py
Expand Up @@ -148,7 +148,10 @@ def stream_command(
process.stdout.close()
return_code = process.wait()
if return_code:
print(process.stderr.read(), file=sys.stderr)
# Some situations may return process without an attached stderr object
# to read from
if process.stderr:
print(process.stderr.read(), file=sys.stderr)
raise subprocess.CalledProcessError(return_code, cmd)


Expand Down
2 changes: 1 addition & 1 deletion spython/version.py
Expand Up @@ -5,7 +5,7 @@
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


__version__ = "0.3.1"
__version__ = "0.3.2"
Copy link
Member

Choose a reason for hiding this comment

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

This should be 0.3.11

Not perfect semver, but allows for tiny changes like this one :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated :)

AUTHOR = "Vanessa Sochat"
AUTHOR_EMAIL = "vsoch@users.noreply.github.com"
NAME = "spython"
Expand Down