With a psycopg2 connection using PsycopgConnectionTracing, creating a psycopg2 cursor with keyword arguments (like Django does for queryset.iterator() cursors) crashes with the following traceback:
Traceback (most recent call last):
File "./crash", line 13, in <module>
cur = tracing.cursor("Name", scrollable=False, withhold=True) # crashes
File "/Users/simoneilting/.pyenv/versions/tracing/lib/python3.8/site-packages/dbapi_opentracing/psycopg2_tracing.py", line 115, in cursor
return PsycopgCursorTracing(conn=self, name=name, cursor_factory=cursor_factory, tracer=self._self_tracer,
File "/Users/simoneilting/.pyenv/versions/tracing/lib/python3.8/site-packages/dbapi_opentracing/psycopg2_tracing.py", line 88, in __new__
return _cursor_factory_classes[factory](*args, **kwargs)
File "/Users/simoneilting/.pyenv/versions/tracing/lib/python3.8/site-packages/dbapi_opentracing/psycopg2_tracing.py", line 83, in __init__
factory.__init__(self, conn, *a, **kw)
TypeError: function takes at most 2 arguments (3 given)
With a psycopg2 connection using
PsycopgConnectionTracing
, creating a psycopg2 cursor with keyword arguments (like Django does forqueryset.iterator()
cursors) crashes with the following traceback:Minimal example to reproduce:
Full example here