Skip to content

Commit ef53ca3

Browse files
tjgalvintgalvin
and
tgalvin
authored
test for stderr before printing (#212)
* test for stderr before printing * bumped version / added to change log * changed to a different semver * corrected version --------- Co-authored-by: tgalvin <[email protected]>
1 parent 31dec0b commit ef53ca3

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to
1717
singularity on pypi), and the versions here will coincide with these releases.
1818

1919
## [master](https://github.com/singularityhub/singularity-cli/tree/master)
20+
- added check to enbsure stderr exists upon a non-zero return code when streaming (0.3.11)
2021
- exposed the stream type option, and ability to capture both stdout and stderr when stream=True (0.3.1)
2122
- dropping support for Singularity 2.x (0.3.0)
2223
- add comment out of STOPSIGNAL (0.2.14)

spython/utils/terminal.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ def stream_command(
148148
process.stdout.close()
149149
return_code = process.wait()
150150
if return_code:
151-
print(process.stderr.read(), file=sys.stderr)
151+
# Some situations may return process without an attached stderr object
152+
# to read from
153+
if process.stderr:
154+
print(process.stderr.read(), file=sys.stderr)
152155
raise subprocess.CalledProcessError(return_code, cmd)
153156

154157

spython/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
66

77

8-
__version__ = "0.3.1"
8+
__version__ = "0.3.11"
99
AUTHOR = "Vanessa Sochat"
1010
AUTHOR_EMAIL = "[email protected]"
1111
NAME = "spython"

0 commit comments

Comments
 (0)