diff options
author | 2020-02-14 10:04:53 -0800 | |
---|---|---|
committer | 2020-02-14 10:09:43 -0800 | |
commit | c6d2400dccc2b5334bfab5f82f1a8bf1ab38f06c (patch) | |
tree | df3b144ecedcff3a0790ce7ec664154b837885d9 /pym/gentoolkit | |
parent | tox: Update tested implementation list (diff) | |
download | gentoolkit-c6d2400dccc2b5334bfab5f82f1a8bf1ab38f06c.tar.gz gentoolkit-c6d2400dccc2b5334bfab5f82f1a8bf1ab38f06c.tar.bz2 gentoolkit-c6d2400dccc2b5334bfab5f82f1a8bf1ab38f06c.zip |
revdep-rebuild: encode Popen args as utf-8 bytes (bug 709610)
Prevent this Popen exception:
UnicodeEncodeError: 'ascii' codec can't encode character '\xe8' in position 20: ordinal not in range(128)
Bug: https://bugs.gentoo.org/709610#c0
Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'pym/gentoolkit')
-rw-r--r-- | pym/gentoolkit/revdep_rebuild/stuff.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pym/gentoolkit/revdep_rebuild/stuff.py b/pym/gentoolkit/revdep_rebuild/stuff.py index 3b0a980..002eb4b 100644 --- a/pym/gentoolkit/revdep_rebuild/stuff.py +++ b/pym/gentoolkit/revdep_rebuild/stuff.py @@ -19,6 +19,7 @@ def call_program(args): @param, args: arument list to pass to subprocess @return str ''' + args = [arg if isinstance(arg, bytes) else arg.encode('utf-8') for arg in args] subp = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = subp.communicate() stdout = stdout.decode('utf-8') |