Opened 4 hours ago

Closed 4 hours ago

#36698 closed Bug (duplicate)

isinstance() arg 2 must be a type, a tuple of types, or a union when using Oracle DB

Reported by: drussca Owned by:
Component: Database layer (models, ORM) Version: 5.2
Severity: Normal Keywords:
Cc: drussca Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (2)

comment:1 by Clifford Gama, 4 hours ago

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.

comment:2 by Clifford Gama, 4 hours ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top