Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sagemaker_training/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def check_error(cmd, error_class, capture_error=False, **kwargs):
_, stderr = process.communicate()
# This will force the stderr to be printed after stdout
# If wait is false and cature error is true, we will never see the stderr.
print(stderr)
print(stderr.decode(errors="replace"))
return_code = process.poll()
else:
stderr = None
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_run_bash(log, popen, entry_point_type_script):
@patch("subprocess.Popen")
@patch("sagemaker_training.logging_config.log_script_invocation")
def test_run_python(log, popen, entry_point_type_script):
popen().communicate.return_value = (None, 0)
popen().communicate.return_value = (None, b"this is stderr")

with pytest.raises(errors.ExecuteUserScriptError):
process.ProcessRunner("launcher.py", ["--lr", "13"], {}).run(capture_error=True)
Expand Down