1 |
Author: zmedico |
2 |
Date: 2009-03-23 02:19:36 +0000 (Mon, 23 Mar 2009) |
3 |
New Revision: 13158 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.6/pym/portage/cache/sqlite.py |
7 |
Log: |
8 |
Add a temporary workaround for bug #263081 (partially reverts r12757). |
9 |
(trunk r13141) |
10 |
|
11 |
Modified: main/branches/2.1.6/pym/portage/cache/sqlite.py |
12 |
=================================================================== |
13 |
--- main/branches/2.1.6/pym/portage/cache/sqlite.py 2009-03-23 02:19:22 UTC (rev 13157) |
14 |
+++ main/branches/2.1.6/pym/portage/cache/sqlite.py 2009-03-23 02:19:36 UTC (rev 13158) |
15 |
@@ -164,6 +164,18 @@ |
16 |
if k not in internal_columns: |
17 |
d[k] = result[0][column_index] |
18 |
|
19 |
+ # As a temporary workaround for bug #263081, convert unicode strings |
20 |
+ # to raw byte strings. This helps to potential unicode errors that can |
21 |
+ # be triggered elsewhere when attempting to join unicode strings with |
22 |
+ # raw byte strings. TODO: Convert all string handling code to use |
23 |
+ # unicode strings instead of raw byte strings (required for py3k |
24 |
+ # compatibility). |
25 |
+ for k, v in d.iteritems(): |
26 |
+ try: |
27 |
+ d[k] = str(v) |
28 |
+ except UnicodeEncodeError: |
29 |
+ pass |
30 |
+ |
31 |
return d |
32 |
|
33 |
def _setitem(self, cpv, values): |