1 |
On 05/18/2015 10:20 AM, Brian Dolbec wrote: |
2 |
> X-Gentoo-Bug: 549826 |
3 |
> X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=549826 |
4 |
> X-Gentoo-forums: https://forums.gentoo.org/viewtopic-t-1017380.html |
5 |
> --- |
6 |
> pym/portage/sync/modules/rsync/rsync.py | 8 +++++--- |
7 |
> 1 file changed, 5 insertions(+), 3 deletions(-) |
8 |
> |
9 |
> diff --git a/pym/portage/sync/modules/rsync/rsync.py b/pym/portage/sync/modules/rsync/rsync.py |
10 |
> index d3b0ae3..47ed1de 100644 |
11 |
> --- a/pym/portage/sync/modules/rsync/rsync.py |
12 |
> +++ b/pym/portage/sync/modules/rsync/rsync.py |
13 |
> @@ -12,6 +12,7 @@ import tempfile |
14 |
> |
15 |
> import portage |
16 |
> from portage import os |
17 |
> +from portage import _unicode_decode |
18 |
> from portage.util import writemsg_level |
19 |
> from portage.output import create_color_func, yellow, blue, bold |
20 |
> good = create_color_func("GOOD") |
21 |
> @@ -145,7 +146,8 @@ class RsyncSync(NewBase): |
22 |
> family, socket.SOCK_STREAM)) |
23 |
> except socket.error as e: |
24 |
> writemsg_level( |
25 |
> - "!!! getaddrinfo failed for '%s': %s\n" % (hostname, e), |
26 |
> + "!!! getaddrinfo failed for '%s': %s\n" |
27 |
> + % (_unicode_decode(hostname), str(e)), |
28 |
> noiselevel=-1, level=logging.ERROR) |
29 |
> |
30 |
> if addrinfos: |
31 |
> @@ -197,8 +199,8 @@ class RsyncSync(NewBase): |
32 |
> if uris: |
33 |
> dosyncuri = uris.pop() |
34 |
> else: |
35 |
> - writemsg("!!! Exhausted addresses for %s\n" % \ |
36 |
> - hostname, noiselevel=-1) |
37 |
> + writemsg("!!! Exhausted addresses for %s\n" |
38 |
> + % _unicode_decode(hostname), noiselevel=-1) |
39 |
> return (1, False) |
40 |
> |
41 |
> if (retries==0): |
42 |
> |
43 |
|
44 |
That str(e) call may be unsafe. We should use _unicode(e) like we do in |
45 |
bintree.py. |
46 |
-- |
47 |
Thanks, |
48 |
Zac |