* [gentoo-commits] portage r14062 - main/trunk/pym/portage
@ 2009-08-15 7:23 Zac Medico (zmedico)
0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-08-15 7:23 UTC (permalink / raw
To: gentoo-commits
Author: zmedico
Date: 2009-08-15 07:23:51 +0000 (Sat, 15 Aug 2009)
New Revision: 14062
Modified:
main/trunk/pym/portage/process.py
Log:
Update import to import portage.os (with unicode wrappers), and use
_unicode_encode() and _content_encoding for encoding unicode env
vars in spawn().
Modified: main/trunk/pym/portage/process.py
===================================================================
--- main/trunk/pym/portage/process.py 2009-08-15 07:08:03 UTC (rev 14061)
+++ main/trunk/pym/portage/process.py 2009-08-15 07:23:51 UTC (rev 14062)
@@ -4,12 +4,14 @@
# $Id$
-import os
import atexit
import signal
import sys
import traceback
+from portage import os
+from portage import _content_encoding
+from portage import _unicode_encode
import portage
portage.proxy.lazyimport.lazyimport(globals(),
'portage.util:dump_traceback',
@@ -182,11 +184,8 @@
# Avoid a potential UnicodeEncodeError from os.execve().
env_bytes = {}
for k, v in env.iteritems():
- if isinstance(k, unicode):
- k = k.encode('utf_8', 'replace')
- if isinstance(v, unicode):
- v = v.encode('utf_8', 'replace')
- env_bytes[k] = v
+ env_bytes[_unicode_encode(k, encoding=_content_encoding)] = \
+ _unicode_encode(v, encoding=_content_encoding)
env = env_bytes
del env_bytes
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-15 7:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-15 7:23 [gentoo-commits] portage r14062 - main/trunk/pym/portage Zac Medico (zmedico)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox