#36675: Oracle dialect depends on implementation detail which was changed in
python-oracledb 3.4
-------------------------------------+-------------------------------------
Reporter: Anthony Tuininga | Type: Bug
Status: new | Component: Database
| layer (models, ORM)
Version: 5.2 | Severity: Normal
Keywords: oracle | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
This issue was reported by a Django user with the upgrade to python-
oracledb 3.4: https://github.com/oracle/python-oracledb/issues/544. The
issue is that the Django Oracle dialect depended on an implementation
detail which changed in python-oracledb 3.4.
The following patch addresses that and is fine for all supported versions
of cx_Oracle and python-oracledb:
{{{
diff --git a/django/db/backends/oracle/base.py
b/django/db/backends/oracle/base.py
index 3b37c38f97..71089c1166 100644
--- a/django/db/backends/oracle/base.py
+++ b/django/db/backends/oracle/base.py
@@ -438,7 +438,7 @@ class OracleParam:
param = 0
if hasattr(param, "bind_parameter"):
self.force_bytes = param.bind_parameter(cursor)
- elif isinstance(param, (Database.Binary, datetime.timedelta)):
+ elif isinstance(param, (bytes, datetime.timedelta)):
self.force_bytes = param
else:
# To transmit to the database, we need Unicode if supported
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36675>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019a04f92b20-aa619936-ec27-49d5-9b87-f307342f7d85-000000%40eu-central-1.amazonses.com.