diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-14 10:56:11 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-14 10:56:11 -0400 |
commit | dbde70a3a23505ab462da3da8639ee22691a0788 (patch) | |
tree | 255690865ccff5322caa643af7ea2d694a94fab7 /lib/sqlalchemy/sql/compiler.py | |
parent | ab38a67995738ccaa17ecbcdd35feace6adcfc16 (diff) | |
download | sqlalchemy-dbde70a3a23505ab462da3da8639ee22691a0788.tar.gz |
workaround for #2838 here. still need to figure out why an ENUM test is suddenly hitting this.
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 9f2abd6f5..22906af54 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -978,6 +978,13 @@ class SQLCompiler(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) |