From: Zac Medico Date: Sun, 30 Aug 2009 10:36:51 +0000 (-0000) Subject: Bug #283223 - Don't call str() inside _db_escape_string(), since it's X-Git-Tag: v2.2_rc41~87 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=dd9eae496d76a7691f1c16fc5fa251fa9a0ed4de;p=portage.git Bug #283223 - Don't call str() inside _db_escape_string(), since it's redundant and it can trigger a UnicodeEncodeError in python-2.x. svn path=/main/trunk/; revision=14171 --- diff --git a/pym/portage/cache/sqlite.py b/pym/portage/cache/sqlite.py index 0a8424880..81c076257 100644 --- a/pym/portage/cache/sqlite.py +++ b/pym/portage/cache/sqlite.py @@ -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"