Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r14146 - main/branches/prefix/pym/portage/dbapi
Date: Mon, 24 Aug 2009 09:44:33
Message-Id: E1MfW6I-0002xv-Sn@stork.gentoo.org
1 Author: grobian
2 Date: 2009-08-24 09:44:30 +0000 (Mon, 24 Aug 2009)
3 New Revision: 14146
4
5 Modified:
6 main/branches/prefix/pym/portage/dbapi/vartree.py
7 Log:
8 Merged from trunk -r14130:14131
9
10 | 14131 | Bug #282306 - Inside |
11 | zmedico | LinkageMap._ObjectKey._generate_object_key(), fall back to |
12 | | utf_8 encoding if a path cannot be encoded under the user's |
13 | | chosen encoding. This should complete the fix for the |
14 | | traceback shown in bug #282115, comment #6. |
15
16
17 Modified: main/branches/prefix/pym/portage/dbapi/vartree.py
18 ===================================================================
19 --- main/branches/prefix/pym/portage/dbapi/vartree.py 2009-08-24 09:42:25 UTC (rev 14145)
20 +++ main/branches/prefix/pym/portage/dbapi/vartree.py 2009-08-24 09:44:30 UTC (rev 14146)
21 @@ -250,6 +250,21 @@
22
23 os = _os_merge
24
25 + try:
26 + _unicode_encode(obj,
27 + encoding=_encodings['merge'], errors='strict')
28 + except UnicodeEncodeError:
29 + # The package appears to have been merged with a
30 + # different value of sys.getfilesystemencoding(),
31 + # so fall back to utf_8 if appropriate.
32 + try:
33 + _unicode_encode(obj,
34 + encoding=_encodings['fs'], errors='strict')
35 + except UnicodeEncodeError:
36 + pass
37 + else:
38 + os = portage.os
39 +
40 abs_path = os.path.join(root, obj.lstrip(os.sep))
41 try:
42 object_stat = os.stat(abs_path)