From: Arfrever Frehtes Taifersar Arahesis Date: Mon, 21 Sep 2009 18:02:08 +0000 (-0000) Subject: Decode all keys in dictionary containing environment passed to os.execve() in portage... X-Git-Tag: v2.2_rc42~67 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d8cd294a4cd4d984f4119d712718b62fab7c1b14;p=portage.git Decode all keys in dictionary containing environment passed to os.execve() in portage.process._exec() for compatibility with Python 3. svn path=/main/trunk/; revision=14352 --- diff --git a/pym/portage/process.py b/pym/portage/process.py index 6ce304b4f..428c66f4c 100644 --- a/pym/portage/process.py +++ b/pym/portage/process.py @@ -11,6 +11,7 @@ import traceback from portage import os from portage import _encodings +from portage import _unicode_decode from portage import _unicode_encode import portage portage.proxy.lazyimport.lazyimport(globals(), @@ -372,8 +373,13 @@ def _exec(binary, mycommand, opt_name, fd_pipes, env, gid, groups, uid, umask, if pre_exec: pre_exec() + # Decode all keys for compatibility with Python 3. + env_decoded = {} + for k, v in env.items(): + env_decoded[_unicode_decode(k)] = v + # And switch to the new process. - os.execve(binary, myargs, env) + os.execve(binary, myargs, env_decoded) def find_binary(binary): """