1 |
On Fri, 28 Nov 2014 04:38:08 -0800 |
2 |
Zac Medico <zmedico@g.o> wrote: |
3 |
|
4 |
> Use _unicode_decode to safely decode bytes returned from time.strftime |
5 |
> for python-2.x (_unicode_decode allows unicode to pass through for |
6 |
> python-3.x). |
7 |
> |
8 |
> X-Gentoo-Bug: 530982 |
9 |
> X-Gentoo-Url: https://bugs.gentoo.org/show_bug.cgi?id=530982 |
10 |
> --- |
11 |
> pym/_emerge/sync/old_tree_timestamp.py | 5 +++-- |
12 |
> 1 file changed, 3 insertions(+), 2 deletions(-) |
13 |
> |
14 |
> diff --git a/pym/_emerge/sync/old_tree_timestamp.py |
15 |
> b/pym/_emerge/sync/old_tree_timestamp.py index aa23a27..aaed18b 100644 |
16 |
> --- a/pym/_emerge/sync/old_tree_timestamp.py |
17 |
> +++ b/pym/_emerge/sync/old_tree_timestamp.py |
18 |
> @@ -7,7 +7,7 @@ import locale |
19 |
> import logging |
20 |
> import time |
21 |
> |
22 |
> -from portage import os |
23 |
> +from portage import os, _unicode_decode |
24 |
> from portage.exception import PortageException |
25 |
> from portage.localization import _ |
26 |
> from portage.output import EOutput |
27 |
> @@ -95,6 +95,7 @@ def old_tree_timestamp_warn(portdir, settings): |
28 |
> whenago(unixtime - lastsync)) |
29 |
> else: |
30 |
> out.ewarn(_("Last emerge --sync was %s.") % \ |
31 |
> - time.strftime('%c', |
32 |
> time.localtime(lastsync))) |
33 |
> + _unicode_decode(time.strftime( |
34 |
> + '%c', time.localtime(lastsync)))) |
35 |
> return True |
36 |
> return False |
37 |
|
38 |
|
39 |
yes, LGTM, merge it |
40 |
|
41 |
-- |
42 |
Brian Dolbec <dolsen> |