From 2074371c6b3196c4158814587c2d996b281a7abf Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 17 Feb 2013 14:12:29 -0800 Subject: [PATCH] _exec: avoid UnicodeEncodeError for execve args --- pym/portage/process.py | 4 ++++ 1 file changed, 4 insertions(+) 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) -- 2.26.2