[Django] #36698: isinstance() arg 2 must be a type, a tuple of types, or a union when using Oracle DB

5 views
Skip to first unread message

Django

unread,
Oct 30, 2025, 7:05:10 AM10/30/25
to django-...@googlegroups.com
#36698: isinstance() arg 2 must be a type, a tuple of types, or a union when using
Oracle DB
-------------------------------------+-------------------------------------
Reporter: drussca | Type: Bug
Status: new | Component: Database
| layer (models, ORM)
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
I have a Django project that uses and Oracle DB. Django version: 5.2.7.

I've had to modify .../django/db/backends/oracle/base.py to make the setup
work as I was getting:

{{{
File "/home/.../lib/python3.12/site-
packages/django/db/backends/oracle/base.py", line 441, in __init__
elif isinstance(param, (Database.Binary, datetime.timedelta)):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union
}}}

After this most things work, EXCEPT when I try to do something like this:

{{{
someobjects =
someclass.somerelatedobject.filter(effdate__lte=reference_date)
someobjectssubset = someobjects.filter(expirdate__gte=reference_date)
otherobjectssubset = someobjects .filter(rlexpirdate__isnull=True)
}}}

For this I still get the isinstance() arg 2 must be a type, a tuple of
types, or a union error.
--
Ticket URL: <https://code.djangoproject.com/ticket/36698>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 30, 2025, 8:03:35 AM10/30/25
to django-...@googlegroups.com
#36698: isinstance() arg 2 must be a type, a tuple of types, or a union when using
Oracle DB
-------------------------------------+-------------------------------------
Reporter: drussca | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 5.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Clifford Gama):

Duplicate of #36646. The issue was fixed for Django 5.2.8. In the meantime
you can downgrade oracledb to a version less than 3.4.0.
--
Ticket URL: <https://code.djangoproject.com/ticket/36698#comment:1>

Django

unread,
Oct 30, 2025, 8:04:08 AM10/30/25
to django-...@googlegroups.com
#36698: isinstance() arg 2 must be a type, a tuple of types, or a union when using
Oracle DB
-------------------------------------+-------------------------------------
Reporter: drussca | Owner: (none)
Type: Bug | Status: closed
Component: Database layer | Version: 5.2
(models, ORM) |
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Clifford Gama):

* resolution: => duplicate
* status: new => closed

--
Ticket URL: <https://code.djangoproject.com/ticket/36698#comment:2>
Reply all
Reply to author
Forward
0 new messages