1 |
commit: c6d2400dccc2b5334bfab5f82f1a8bf1ab38f06c |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Feb 14 18:04:53 2020 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Feb 14 18:09:43 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=c6d2400d |
7 |
|
8 |
revdep-rebuild: encode Popen args as utf-8 bytes (bug 709610) |
9 |
|
10 |
Prevent this Popen exception: |
11 |
|
12 |
UnicodeEncodeError: 'ascii' codec can't encode character '\xe8' in position 20: ordinal not in range(128) |
13 |
|
14 |
Bug: https://bugs.gentoo.org/709610#c0 |
15 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
16 |
|
17 |
pym/gentoolkit/revdep_rebuild/stuff.py | 1 + |
18 |
1 file changed, 1 insertion(+) |
19 |
|
20 |
diff --git a/pym/gentoolkit/revdep_rebuild/stuff.py b/pym/gentoolkit/revdep_rebuild/stuff.py |
21 |
index 3b0a980..002eb4b 100644 |
22 |
--- a/pym/gentoolkit/revdep_rebuild/stuff.py |
23 |
+++ b/pym/gentoolkit/revdep_rebuild/stuff.py |
24 |
@@ -19,6 +19,7 @@ def call_program(args): |
25 |
@param, args: arument list to pass to subprocess |
26 |
@return str |
27 |
''' |
28 |
+ args = [arg if isinstance(arg, bytes) else arg.encode('utf-8') for arg in args] |
29 |
subp = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
30 |
stdout, stderr = subp.communicate() |
31 |
stdout = stdout.decode('utf-8') |