Skip to content

Commit 52bc013

Browse files
committed
UnicodeDecodeError for weird enviroment variables fix
1 parent b01803c commit 52bc013

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libs/process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def __init__(self, cmd, cwd=None, env=None, flags=None,
277277
for key, value in env.items():
278278
try:
279279
_enc_env[key.encode(encoding)] = value.encode(encoding)
280-
except UnicodeEncodeError:
280+
except (UnicodeEncodeError, UnicodeDecodeError):
281281
# Could not encode it, warn we are dropping it.
282282
log.warn("Could not encode environment variable %r "
283283
"so removing it", key)

0 commit comments

Comments
 (0)