Bug 784841 - Part 17: Handle unicode during packaging; r=glandium

This commit is contained in:
Gregory Szorc 2013-02-25 12:47:17 -08:00
parent 39ec7e4cdf
commit b57b13255c

View File

@ -78,6 +78,13 @@ class ToolLauncher(object):
env[p] = extra_linker_path
for e in extra_env:
env[e] = extra_env[e]
# Work around a bug in Python 2.7.2 and lower where unicode types in
# environment variables aren't handled by subprocess.
for k, v in env.items():
if isinstance(v, unicode):
env[k] = v.encode('utf-8')
print >>errors.out, 'Executing', ' '.join(cmd)
errors.out.flush()
return subprocess.call(cmd, env=env)