Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#11033 closed (fixed)

cx_Oracle.UNICODE missing if cx_Oracle version 5.0.1 is compiled without Unicode support

Reported by: Jirka Vejrazka Owned by: Matt Boersma
Component: Database layer (models, ORM) Version: master
Severity: Keywords: oracle unicode cx_Oracle
Cc: Matt Boersma Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Oracle test failed with:

ERROR: test_get_table_description_types (regressiontests.introspection.tests.IntrospectionTests)
Traceback (most recent call last):
  File "/home/jirka/dev/django/tests/regressiontests/introspection/", line 28, in _inner
    return func(*args, **kwargs)
  File "/home/jirka/dev/django/tests/regressiontests/introspection/", line 79, in test_get_table_description_types
    self.assertEqual([datatype(r[1]) for r in desc],
  File "/home/jirka/dev/django/tests/regressiontests/introspection/", line 109, in datatype
    dt = connection.introspection.data_types_reverse[dbtype]
KeyError: <type 'cx_Oracle.UNICODE'>

Patch is based on email from Ian Kelly:

test_get_table_description_types: This only occurs if you're running cx_Oracle 5.0.1 without the WITH_UNICODE compilation flag. To fix it, we just need to add cx_Oracle.UNICODE to the data_types_reverse dict, mapping it to CharField. cx_Oracle.UNICODE isn't defined in all versions of cx_Oracle, so there needs to be a check that it actually exists before referencing it.

Attachments (1)

oracle_cx_unicode.diff (606 bytes) - added by Jirka Vejrazka 10 years ago.

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by Jirka Vejrazka

Attachment: oracle_cx_unicode.diff added

comment:1 Changed 10 years ago by Jirka Vejrazka

Component: UncategorizedDatabase layer (models, ORM)

comment:2 Changed 10 years ago by Jirka Vejrazka

Version: 1.0SVN

comment:3 Changed 10 years ago by Matt Boersma

Cc: Matt Boersma added

comment:4 Changed 10 years ago by Matt Boersma

milestone: 1.2
Owner: changed from Ian Kelly to Matt Boersma
Status: newassigned

comment:5 Changed 10 years ago by Matt Boersma

milestone: 1.21.1

comment:6 Changed 10 years ago by Matt Boersma

Resolution: fixed
Status: assignedclosed

(In [10749]) Fixed #11033 -- handle cx_Oracle.UNICODE when driver was compiled without Unicode support. Thanks, JirkaV.

comment:7 Changed 7 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top