Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#11033 closed (fixed)

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

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

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 JirkaV 5 years ago.

Download all attachments as: .zip

Change History (8)

Changed 5 years ago by JirkaV

comment:1 Changed 5 years ago by JirkaV

  • Component changed from Uncategorized to Database layer (models, ORM)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 5 years ago by JirkaV

  • Version changed from 1.0 to SVN

comment:3 Changed 5 years ago by mboersma

  • Cc mboersma added

comment:4 Changed 5 years ago by mboersma

  • milestone set to 1.2
  • Owner changed from ikelly to mboersma
  • Status changed from new to assigned

comment:5 Changed 5 years ago by mboersma

  • milestone changed from 1.2 to 1.1

comment:6 Changed 5 years ago by mboersma

  • Resolution set to fixed
  • Status changed from assigned to closed

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

comment:7 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.