Skip to content

Commit

Permalink
specify how errors should be handled during decoding (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielholanda committed Apr 3, 2024
1 parent 7c13aa6 commit 69a203e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/turnkeyml/run/plugin_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,19 @@ def logged_subprocess(
cwd=cwd,
)
except Exception as e: # pylint: disable=broad-except
log_stdout = e.stdout.decode("utf-8") # pylint: disable=no-member
log_stderr = e.stderr.decode("utf-8") # pylint: disable=no-member
log_stdout = e.stdout.decode( # pylint: disable=no-member
"utf-8", errors="replace"
)
log_stderr = e.stderr.decode( # pylint: disable=no-member
"utf-8", errors="replace"
)
raise CondaError(
f"Exception {e} encountered, \n\nstdout was: "
f"\n{log_stdout}\n\n and stderr was: \n{log_stderr}"
)
else:
log_stdout = proc.stdout.decode("utf-8")
log_stderr = proc.stderr.decode("utf-8")
log_stdout = proc.stdout.decode("utf-8", errors="replace")
log_stderr = proc.stderr.decode("utf-8", errors="replace")
finally:
if log_to_std_streams:
# Print log to stdout
Expand Down
2 changes: 1 addition & 1 deletion src/turnkeyml/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.2"
__version__ = "2.0.3"

0 comments on commit 69a203e

Please sign in to comment.