#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.