summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-23 02:19:36 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-23 02:19:36 +0000
commitc58098796a0302247c77da2fdefb6b7bd21c0624 (patch)
tree7ed8e83824e35405c78f12aa122ce5d98d40d7a3
parentf75b60995bf4da057708e3f79f6b097c16996366 (diff)
downloadportage-c58098796a0302247c77da2fdefb6b7bd21c0624.tar.gz
portage-c58098796a0302247c77da2fdefb6b7bd21c0624.tar.bz2
portage-c58098796a0302247c77da2fdefb6b7bd21c0624.zip
Add a temporary workaround for bug #263081 (partially reverts r12757).
(trunk r13141) svn path=/main/branches/2.1.6/; revision=13158
-rw-r--r--pym/portage/cache/sqlite.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pym/portage/cache/sqlite.py b/pym/portage/cache/sqlite.py
index aa5c30468..6588b3cc7 100644
--- a/pym/portage/cache/sqlite.py
+++ b/pym/portage/cache/sqlite.py
@@ -164,6 +164,18 @@ class database(fs_template.FsBased):
if k not in internal_columns:
d[k] = result[0][column_index]
+ # As a temporary workaround for bug #263081, convert unicode strings
+ # to raw byte strings. This helps to potential unicode errors that can
+ # be triggered elsewhere when attempting to join unicode strings with
+ # raw byte strings. TODO: Convert all string handling code to use
+ # unicode strings instead of raw byte strings (required for py3k
+ # compatibility).
+ for k, v in d.iteritems():
+ try:
+ d[k] = str(v)
+ except UnicodeEncodeError:
+ pass
+
return d
def _setitem(self, cpv, values):