1 |
Fixes UnicodeDecodeError in Python 2 with getaddrinfo() error messages |
2 |
that contain non-ASCII characters, e.g. in pl_PL.UTF-8 locale. |
3 |
--- |
4 |
pym/_emerge/actions.py | 3 ++- |
5 |
1 file changed, 2 insertions(+), 1 deletion(-) |
6 |
|
7 |
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py |
8 |
index e482744..66e18a4 100644 |
9 |
--- a/pym/_emerge/actions.py |
10 |
+++ b/pym/_emerge/actions.py |
11 |
@@ -2345,7 +2345,8 @@ def _sync_repo(emerge_config, repo): |
12 |
family, socket.SOCK_STREAM)) |
13 |
except socket.error as e: |
14 |
writemsg_level( |
15 |
- "!!! getaddrinfo failed for '%s': %s\n" % (hostname, e), |
16 |
+ "!!! getaddrinfo failed for '%s': %s\n" % (hostname, |
17 |
+ _unicode_decode(e.strerror, encoding=_encodings['stdio'])), |
18 |
noiselevel=-1, level=logging.ERROR) |
19 |
|
20 |
if addrinfos: |
21 |
-- |
22 |
2.0.4 |