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