Fixed #19606 -- Adjusted cx_Oracle unicode detection.
This commit is contained in:
parent
0375244eae
commit
d194f29057
|
@ -58,10 +58,11 @@ from django.utils import timezone
|
||||||
DatabaseError = Database.DatabaseError
|
DatabaseError = Database.DatabaseError
|
||||||
IntegrityError = Database.IntegrityError
|
IntegrityError = Database.IntegrityError
|
||||||
|
|
||||||
|
# Check whether cx_Oracle was compiled with the WITH_UNICODE option if cx_Oracle is pre-5.1. This will
|
||||||
# Check whether cx_Oracle was compiled with the WITH_UNICODE option. This will
|
# also be True for cx_Oracle 5.1 and in Python 3.0. See #19606
|
||||||
# also be True in Python 3.0.
|
if int(Database.version.split('.', 1)[0]) >= 5 and \
|
||||||
if int(Database.version.split('.', 1)[0]) >= 5 and not hasattr(Database, 'UNICODE'):
|
(int(Database.version.split('.', 2)[1]) >= 1 or
|
||||||
|
not hasattr(Database, 'UNICODE')):
|
||||||
convert_unicode = force_text
|
convert_unicode = force_text
|
||||||
else:
|
else:
|
||||||
convert_unicode = force_bytes
|
convert_unicode = force_bytes
|
||||||
|
|
Loading…
Reference in New Issue