Skip to content

Commit

Permalink
Set encoding when manipulating stdout
Browse files Browse the repository at this point in the history
When manipulating stdout please set the encoding,  as the subprocess will use the default of the system it might get another encode than unicode that python uses as a default when decoding it. That is a particular problem when using mamba because it outputs some symbols that if the default of the system is not utf-8 or other similar encodings it will raise an exception.
  • Loading branch information
marcelotrevisani authored Mar 15, 2022
1 parent 9a1132d commit 2cc2db2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions conda_lock/invoke_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def _invoke_conda(
stderr=subprocess.PIPE,
bufsize=1,
universal_newlines=True,
encoding="utf-8",
) as p:
stdout = []
if p.stdout:
Expand Down

0 comments on commit 2cc2db2

Please sign in to comment.