Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r14130 - main/trunk/pym/portage/dbapi
Date: Sun, 23 Aug 2009 07:25:43
Message-Id: E1Mf7SP-0000ux-Gd@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-08-23 07:25:40 +0000 (Sun, 23 Aug 2009)
3 New Revision: 14130
4
5 Modified:
6 main/trunk/pym/portage/dbapi/vartree.py
7 Log:
8 Bug #282306 - Inside dblink._find_libs_to_preserve(), fall back to utf_8
9 encoding if a path cannot be encoded under the user's chosen encoding. This
10 fixes the traceback shown in bug 282115, comment #6.
11
12
13 Modified: main/trunk/pym/portage/dbapi/vartree.py
14 ===================================================================
15 --- main/trunk/pym/portage/dbapi/vartree.py 2009-08-22 23:44:59 UTC (rev 14129)
16 +++ main/trunk/pym/portage/dbapi/vartree.py 2009-08-23 07:25:40 UTC (rev 14130)
17 @@ -2717,6 +2717,23 @@
18 provider_nodes = set()
19 # Create provider nodes and add them to the graph.
20 for f_abs in old_contents:
21 +
22 + if os is _os_merge:
23 + try:
24 + _unicode_encode(f_abs,
25 + encoding=_encodings['merge'], errors='strict')
26 + except UnicodeEncodeError:
27 + # The package appears to have been merged with a
28 + # different value of sys.getfilesystemencoding(),
29 + # so fall back to utf_8 if appropriate.
30 + try:
31 + _unicode_encode(f_abs,
32 + encoding=_encodings['fs'], errors='strict')
33 + except UnicodeEncodeError:
34 + pass
35 + else:
36 + os = portage.os
37 +
38 f = f_abs[root_len:]
39 if self.isowner(f, root):
40 continue