From: Fabian Groffen Date: Mon, 21 Sep 2009 18:14:26 +0000 (-0000) Subject: Merged from trunk -r14343:14352 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=96e6faa206a44642b730f147c177bf8849b68905;p=portage.git Merged from trunk -r14343:14352 | 14347 | 'filtered_auxdbkeys' should be a list to allow sorting. | | arfrever | | | 14352 | Decode all keys in dictionary containing environment passed | | arfrever | to os.execve() in portage.process._exec() for compatibility | | | with Python 3. | svn path=/main/branches/prefix/; revision=14356 --- diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index f0950ce95..40557de15 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -340,7 +340,7 @@ class portdbapi(dbapi): # XXX: REMOVE THIS ONCE UNUSED_0 IS YANKED FROM auxdbkeys # ~harring - filtered_auxdbkeys = filter(lambda x: not x.startswith("UNUSED_0"), auxdbkeys) + filtered_auxdbkeys = list(filter(lambda x: not x.startswith("UNUSED_0"), auxdbkeys)) filtered_auxdbkeys.sort() from portage.cache import metadata_overlay, volatile if not depcachedir_w_ok: 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): """