Opened 16 years ago

Closed 16 years ago

Last modified 13 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: dev
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

Description

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/tests.py", line 28, in _inner
    return func(*args, **kwargs)
  File "/home/jirka/dev/django/tests/regressiontests/introspection/tests.py", 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/tests.py", 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 16 years ago.

Download all attachments as: .zip

Change History (8)

by Jirka Vejrazka, 16 years ago

Attachment: oracle_cx_unicode.diff added

comment:1 by Jirka Vejrazka, 16 years ago

Component: UncategorizedDatabase layer (models, ORM)

comment:2 by Jirka Vejrazka, 16 years ago

Version: 1.0SVN

comment:3 by Matt Boersma, 16 years ago

Cc: Matt Boersma added

comment:4 by Matt Boersma, 16 years ago

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

comment:5 by Matt Boersma, 16 years ago

milestone: 1.21.1

comment:6 by Matt Boersma, 16 years ago

Resolution: fixed
Status: assignedclosed

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

comment:7 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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