From: Zac Medico Date: Sun, 17 Feb 2013 22:12:29 +0000 (-0800) Subject: _exec: avoid UnicodeEncodeError for execve args X-Git-Tag: v2.2.0_alpha164~22 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2074371c6b3196c4158814587c2d996b281a7abf;p=portage.git _exec: avoid UnicodeEncodeError for execve args --- diff --git a/pym/portage/process.py b/pym/portage/process.py index 89ebd0553..f00775cf5 100644 --- a/pym/portage/process.py +++ b/pym/portage/process.py @@ -387,6 +387,10 @@ def _exec(binary, mycommand, opt_name, fd_pipes, env, gid, groups, uid, umask, myargs = [opt_name] myargs.extend(mycommand[1:]) + # Avoid a potential UnicodeEncodeError from os.execve(). + myargs = [_unicode_encode(x, encoding=_encodings['fs'], + errors='strict') for x in myargs] + # Use default signal handlers in order to avoid problems # killing subprocesses as reported in bug #353239. signal.signal(signal.SIGINT, signal.SIG_DFL)