1 |
Author: zmedico |
2 |
Date: 2009-08-22 19:05:32 +0000 (Sat, 22 Aug 2009) |
3 |
New Revision: 14125 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/portage/dbapi/vartree.py |
7 |
Log: |
8 |
Bug #282306 - Inside dblink._security_check(), fall back to utf_8 encoding |
9 |
it a path cannot be encoded under the user's chosen encoding. |
10 |
|
11 |
|
12 |
Modified: main/trunk/pym/portage/dbapi/vartree.py |
13 |
=================================================================== |
14 |
--- main/trunk/pym/portage/dbapi/vartree.py 2009-08-22 07:52:43 UTC (rev 14124) |
15 |
+++ main/trunk/pym/portage/dbapi/vartree.py 2009-08-22 19:05:32 UTC (rev 14125) |
16 |
@@ -3136,6 +3136,22 @@ |
17 |
0 == i % self._file_merge_yield_interval: |
18 |
scheduler.scheduleYield() |
19 |
|
20 |
+ if os is _os_merge: |
21 |
+ try: |
22 |
+ _unicode_encode(path, |
23 |
+ encoding=_encodings['merge'], errors='strict') |
24 |
+ except UnicodeEncodeError: |
25 |
+ # The package appears to have been merged with a |
26 |
+ # different value of sys.getfilesystemencoding(), |
27 |
+ # so fall back to utf_8 if appropriate. |
28 |
+ try: |
29 |
+ _unicode_encode(path, |
30 |
+ encoding=_encodings['fs'], errors='strict') |
31 |
+ except UnicodeEncodeError: |
32 |
+ pass |
33 |
+ else: |
34 |
+ os = portage.os |
35 |
+ |
36 |
try: |
37 |
s = os.lstat(path) |
38 |
except OSError, e: |