[Django] #36650: oracledb-3.4.0 -> TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union

4 views
Skip to first unread message

Django

unread,
Oct 8, 2025, 8:45:54 AM10/8/25
to django-...@googlegroups.com
#36650: oracledb-3.4.0 -> TypeError: isinstance() arg 2 must be a type, a tuple of
types, or a union
-------------------------------------+-------------------------------------
Reporter: marcuoli | Type:
| Uncategorized
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
-------------------------------------+-------------------------------------
When upgrading oracledb to version 3.4.0, Django stops working with error
"TypeError: isinstance() arg 2 must be a type, a tuple of types, or a
union."

Using oracledb-3.3.0 works as expected.

...
Performing system checks...

System check identified no issues (0 silenced).
2025-10-08 09:18:33,020: INFO: acst_app.models.file: 10001
2025-10-08 09:18:33,023: INFO: acst_app.models.file: 10001 elapsed time
00m00s
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/root/.pyenv/versions/3.13.7/lib/python3.13/threading.py", line
1043, in _bootstrap_inner
self.run()
~~~~~~~~^^
File "/root/.pyenv/versions/3.13.7/lib/python3.13/threading.py", line
994, in run
self._target(*self._args, **self._kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
~~^^^^^^^^^^^^^^^^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/core/management/commands/runserver.py", line 137, in
inner_run
self.check_migrations()
~~~~~~~~~~~~~~~~~~~~~^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/core/management/base.py", line 587, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/db/migrations/executor.py", line 18, in __init__
self.loader = MigrationLoader(self.connection)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/db/migrations/loader.py", line 58, in __init__
self.build_graph()
~~~~~~~~~~~~~~~~^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/db/migrations/loader.py", line 235, in build_graph
self.applied_migrations = recorder.applied_migrations()
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/db/migrations/recorder.py", line 89, in applied_migrations
if self.has_table():
~~~~~~~~~~~~~~^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/db/migrations/recorder.py", line 63, in has_table
with self.connection.cursor() as cursor:
~~~~~~~~~~~~~~~~~~~~~~^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/db/backends/base/base.py", line 320, in cursor
return self._cursor()
~~~~~~~~~~~~^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/db/backends/base/base.py", line 296, in _cursor
self.ensure_connection()
~~~~~~~~~~~~~~~~~~~~~~^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/db/backends/base/base.py", line 279, in ensure_connection
self.connect()
~~~~~~~~~~~~^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/db/backends/base/base.py", line 258, in connect
self.init_connection_state()
~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/db/backends/oracle/base.py", line 336, in
init_connection_state
cursor.execute(
~~~~~~~~~~~~~~^
"SELECT 1 FROM DUAL WHERE DUMMY %s"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
% self._standard_operators["contains"],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
["X"],
^^^^^^
)
^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/db/backends/oracle/base.py", line 630, in execute
query, params = self._fix_for_params(query, params,
unify_by_values=True)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/db/backends/oracle/base.py", line 627, in _fix_for_params
return query, self._format_params(params)
~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/site-
packages/django/db/backends/oracle/base.py", line 555, in _format_params
return {k: OracleParam(v, self, True) for k, v in params.items()}
~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/root/.pyenv/versions/django_acst_venv_3137/lib/python3.13/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
--
Ticket URL: <https://code.djangoproject.com/ticket/36650>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 8, 2025, 8:48:25 AM10/8/25
to django-...@googlegroups.com
#36650: oracledb-3.4.0 -> TypeError: isinstance() arg 2 must be a type, a tuple of
types, or a union
-------------------------------------+-------------------------------------
Reporter: MV | Owner: (none)
Type: Uncategorized | 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
-------------------------------------+-------------------------------------
Description changed by MV:

Old description:
New description:

When upgrading oracledb to version 3.4.0, Django stops working with error
"TypeError: isinstance() arg 2 must be a type, a tuple of types, or a
union."

Using oracledb-3.3.0 works as expected.

``
--
Ticket URL: <https://code.djangoproject.com/ticket/36650#comment:1>

Django

unread,
Oct 8, 2025, 9:08:18 AM10/8/25
to django-...@googlegroups.com
#36650: oracledb-3.4.0 -> TypeError: isinstance() arg 2 must be a type, a tuple of
types, or a union
-------------------------------------+-------------------------------------
Reporter: MV | Owner: (none)
Type: Uncategorized | 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
-------------------------------------+-------------------------------------
Description changed by MV:

Old description:

> When upgrading oracledb to version 3.4.0, Django stops working with error
> "TypeError: isinstance() arg 2 must be a type, a tuple of types, or a
> union."
>
> Using oracledb-3.3.0 works as expected.
>
> ``
{{{#!python
Ticket URL: <https://code.djangoproject.com/ticket/36650#comment:2>

Django

unread,
Oct 8, 2025, 9:13:23 AM10/8/25
to django-...@googlegroups.com
#36650: oracledb-3.4.0 -> TypeError: isinstance() arg 2 must be a type, a tuple of
types, or a union
-------------------------------------+-------------------------------------
Reporter: MV | 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
-------------------------------------+-------------------------------------
Changes (by MV):

* type: Uncategorized => Bug

--
Ticket URL: <https://code.djangoproject.com/ticket/36650#comment:3>

Django

unread,
Oct 8, 2025, 9:57:52 AM10/8/25
to django-...@googlegroups.com
#36650: oracledb-3.4.0 -> TypeError: isinstance() arg 2 must be a type, a tuple of
types, or a union
-------------------------------------+-------------------------------------
Reporter: MV | 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

Comment:

Duplicate of #36646.
--
Ticket URL: <https://code.djangoproject.com/ticket/36650#comment:4>
Reply all
Reply to author
Forward
0 new messages