Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r14171 - main/trunk/pym/portage/cache
Date: Sun, 30 Aug 2009 05:27:53
Message-Id: E1MhhmG-0006Kd-BW@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-08-30 10:36:51 +0000 (Sun, 30 Aug 2009)
3 New Revision: 14171
4
5 Modified:
6 main/trunk/pym/portage/cache/sqlite.py
7 Log:
8 Bug #283223 - Don't call str() inside _db_escape_string(), since it's
9 redundant and it can trigger a UnicodeEncodeError in python-2.x.
10
11
12 Modified: main/trunk/pym/portage/cache/sqlite.py
13 ===================================================================
14 --- main/trunk/pym/portage/cache/sqlite.py 2009-08-29 18:50:42 UTC (rev 14170)
15 +++ main/trunk/pym/portage/cache/sqlite.py 2009-08-30 10:36:51 UTC (rev 14171)
16 @@ -48,7 +48,7 @@
17 def _db_escape_string(self, s):
18 """meta escaping, returns quoted string for use in sql statements"""
19 # This is equivalent to the _quote function from pysqlite 1.1.
20 - return "'%s'" % str(s).replace("'","''")
21 + return "'%s'" % s.replace("'", "''")
22
23 def _db_init_connection(self, config):
24 self._dbpath = self.location + ".sqlite"