]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
workaround for #2838 here. still need to figure out why an ENUM test is suddenly...
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 14 Oct 2013 14:56:11 +0000 (10:56 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 14 Oct 2013 14:58:21 +0000 (10:58 -0400)
lib/sqlalchemy/sql/compiler.py

index 0a1fcdfab19468d318913bc6f3309ff38c750212..d537536911bd3471e88db483bcc4d2d18f4caa58 100644 (file)
@@ -845,6 +845,13 @@ class SQLCompiler(engine.Compiled):
             return repr(value)
         elif isinstance(value, decimal.Decimal):
             return str(value)
+        elif isinstance(value, util.binary_type):
+            # only would occur on py3k b.c. on 2k the string_types
+            # directive above catches this.
+            # see #2838
+            value = value.decode(self.dialect.encoding).replace("'", "''")
+            return "'%s'" % value
+
         else:
             raise NotImplementedError(
                         "Don't know how to literal-quote value %r" % value)