Opened 8 years ago

Closed 7 years ago

#10566 closed (fixed)

Support cx_Oracle compiled with WITH_UNICODE

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

Description

If cx_Oracle 5.0.1+ is compiled with the WITH_UNICODE option, then it expects unicode inputs and rejects str inputs. Currently the oracle backend only passes encoded strings and so won't work with this setup.

This is something we'll need to address eventually as Django moves to Python 3.0 support, but another use case may be when running Django together with other software in the same Apache instance, resulting in NLS_LANG confusion, as documented in this thread: http://groups.google.com/group/django-users/browse_thread/thread/fb812a572168bfc8?hl=en

Attachments (2)

10566.diff (2.9 KB) - added by Ian Kelly 8 years ago.
10566-2.diff (4.3 KB) - added by Ian Kelly 8 years ago.
This revised patch avoids a bug where calling setinputsizes with an NCLOB argument results in an error under cx_Oracle 5.0.1 with unicode.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 8 years ago by Malcolm Tredinnick

Triage Stage: UnreviewedAccepted

This should be fairly routine, since we already do a bunch of conversions more or less in one place and we can hook in there. The only potential challenge is knowing when to do this. Is it detectable from querying something in cx_oracle? Or do we need to add a DATABASE_OPTIONS key for it so that the user can tell us?

Changed 8 years ago by Ian Kelly

Attachment: 10566.diff added

comment:2 Changed 8 years ago by Ian Kelly

Has patch: set

This patch seems to work, but I haven't run the full test suite or the gis tests yet.

Changed 8 years ago by Ian Kelly

Attachment: 10566-2.diff added

This revised patch avoids a bug where calling setinputsizes with an NCLOB argument results in an error under cx_Oracle 5.0.1 with unicode.

comment:3 Changed 7 years ago by Ian Kelly

Resolution: fixed
Status: newclosed

(In [11477]) Fixed #10566: Added support for cx_Oracle compiled with the WITH_UNICODE flag.

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