mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1050561 - Decode string when building an environment block to support non-ASCII environment variables. r=ahalberstadt
This commit is contained in:
parent
9db15a4aef
commit
ceb176ce0d
@ -95,6 +95,16 @@ class ProcessHandlerMixin(object):
|
||||
os.setpgid(0, 0)
|
||||
preexec_fn = setpgidfn
|
||||
|
||||
if isinstance(env, dict):
|
||||
tmp_env = {}
|
||||
for k, v in env.iteritems():
|
||||
if isinstance(k, bytes):
|
||||
k = k.decode(sys.getfilesystemencoding() or 'utf-8', 'replace')
|
||||
if isinstance(v, bytes):
|
||||
v = v.decode(sys.getfilesystemencoding() or 'utf-8', 'replace')
|
||||
tmp_env[k] = v
|
||||
env = tmp_env
|
||||
|
||||
try:
|
||||
subprocess.Popen.__init__(self, args, bufsize, executable,
|
||||
stdin, stdout, stderr,
|
||||
|
Loading…
Reference in New Issue
Block a user