Code

Opened 5 years ago

Closed 5 years ago

#10566 closed (fixed)

Support cx_Oracle compiled with WITH_UNICODE

Reported by: ikelly Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords: oracle unicode
Cc: mboersma 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 ikelly 5 years ago.
10566-2.diff (4.3 KB) - added by ikelly 5 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 5 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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 5 years ago by ikelly

comment:2 Changed 5 years ago by ikelly

  • Has patch set

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

Changed 5 years ago by ikelly

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 5 years ago by ikelly

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

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

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.