Merged from trunk -r14343:14352
authorFabian Groffen <grobian@gentoo.org>
Mon, 21 Sep 2009 18:14:26 +0000 (18:14 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 21 Sep 2009 18:14:26 +0000 (18:14 -0000)
   | 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

pym/portage/dbapi/porttree.py
pym/portage/process.py

index f0950ce95c8c29b4ba2fa788639523f9f6d602ee..40557de155d8a1b6b58c37e8868b8c3662052fbf 100644 (file)
@@ -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:
index 6ce304b4f58a9b66e53a5e0308b808f0cb0a735f..428c66f4cb51432f7702839426adc288c57f3664 100644 (file)
@@ -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):
        """