[Sqlalchemy-commits] sqlalchemy: The cx_oracle dialect will no longer run the bind pa...
Brought to you by:
zzzeek
From: <co...@sq...> - 2013-02-08 17:42:54
|
details: http://hg.sqlalchemy.org/sqlalchemy/sqlalchemy/rev/706bb338a7af changeset: 9139:706bb338a7af user: Mike Bayer <mi...@zz...> date: Fri Feb 08 12:42:36 2013 -0500 description: 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. diffstat: doc/build/changelog/changelog_08.rst | 9 +++++++++ lib/sqlalchemy/engine/default.py | 4 +++- 2 files changed, 12 insertions(+), 1 deletions(-) diffs (33 lines): diff -r eec3f59080ac -r 706bb338a7af doc/build/changelog/changelog_08.rst --- a/doc/build/changelog/changelog_08.rst Fri Feb 08 01:20:41 2013 -0500 +++ b/doc/build/changelog/changelog_08.rst Fri Feb 08 12:42:36 2013 -0500 @@ -7,6 +7,15 @@ :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 -r eec3f59080ac -r 706bb338a7af lib/sqlalchemy/engine/default.py --- a/lib/sqlalchemy/engine/default.py Fri Feb 08 01:20:41 2013 -0500 +++ b/lib/sqlalchemy/engine/default.py Fri Feb 08 12:42:36 2013 -0500 @@ -744,7 +744,9 @@ (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: |