From: Mike Bayer Date: Fri, 8 Feb 2013 17:42:36 +0000 (-0500) Subject: The cx_oracle dialect will no longer run the bind parameter names X-Git-Tag: rel_0_8_0~23^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22b31818666d0c3a7f527d06354b6bcdb1304c90;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git The cx_oracle dialect will no longer run the bind parameter names through ``encode()``, as this is not valid on Python 3, and prevented statements from functioning correctly on Python 3. We now encode only if ``supports_unicode_binds`` is False, which is not the case for cx_oracle when at least version 5 of cx_oracle is used. --- diff --git a/doc/build/changelog/changelog_08.rst b/doc/build/changelog/changelog_08.rst index d3031e5e20..296141c799 100644 --- a/doc/build/changelog/changelog_08.rst +++ b/doc/build/changelog/changelog_08.rst @@ -6,6 +6,15 @@ .. changelog:: :version: 0.8.0 + .. change:: + :tags: bug, oracle + + The cx_oracle dialect will no longer run the bind parameter names + through ``encode()``, as this is not valid on Python 3, and prevented + statements from functioning correctly on Python 3. We now + encode only if ``supports_unicode_binds`` is False, which is not + the case for cx_oracle when at least version 5 of cx_oracle is used. + .. change:: :tags: bug, orm :tickets: 2661 diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index 918b452137..1db0f2ce4a 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -744,7 +744,9 @@ class DefaultExecutionContext(interfaces.ExecutionContext): (not exclude_types or dbtype not in exclude_types): if translate: key = translate.get(key, key) - inputsizes[self.dialect._encoder(key)[0]] = dbtype + if not self.dialect.supports_unicode_binds: + key = self.dialect._encoder(key)[0] + inputsizes[key] = dbtype try: self.cursor.setinputsizes(**inputsizes) except Exception, e: