Bug #283223 - Don't call str() inside _db_escape_string(), since it's
authorZac Medico <zmedico@gentoo.org>
Sun, 30 Aug 2009 10:36:51 +0000 (10:36 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 30 Aug 2009 10:36:51 +0000 (10:36 -0000)
redundant and it can trigger a UnicodeEncodeError in python-2.x.

svn path=/main/trunk/; revision=14171

pym/portage/cache/sqlite.py

index 0a842488000eff64cd5ac7a1e20bc62bc6a032bb..81c07625779808820673b60b5368cf9015986905 100644 (file)
@@ -48,7 +48,7 @@ class database(fs_template.FsBased):
        def _db_escape_string(self, s):
                """meta escaping, returns quoted string for use in sql statements"""
                # This is equivalent to the _quote function from pysqlite 1.1.
-               return "'%s'" % str(s).replace("'","''")
+               return "'%s'" % s.replace("'", "''")
 
        def _db_init_connection(self, config):
                self._dbpath = self.location + ".sqlite"