-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: argument 2 must be a connection, cursor or None when migrate to django 3.1.1 #243
Comments
Hi, Looked at the Django release notes of v3.1.1 couldn't find anything that should cause this issue. Would you be able post small repro code ? |
This is the same issue as mentioned in #245 , and I'm also unable to use x-ray because of this |
Further investigation reveals that this change is the culprit: Issue tracker: https://code.djangoproject.com/ticket/31956 |
I have monekypatched the Seems to work fine so far. Below is a basic example for patching this def monkeypatch_psycopg2_register_type():
import psycopg2._json
f = psycopg2._json.register_type
def func(obj, conn_or_curs):
from aws_xray_sdk.ext.dbapi2 import XRayTracedConn
if type(conn_or_curs) == XRayTracedConn:
conn_or_curs = conn_or_curs.__wrapped__
return f(obj, conn_or_curs)
psycopg2._json.register_type = func |
Any updates on this? I'd hate to have to choose between installing Django 3.1 with no maintenance releases and this plugin. Edit: workaround is to |
Hi @mjhanke |
@srprash Any updates on this? We're also in need of upgrading the Django version in one our projects so hoping a fix is in the works here. |
@srprash are there any updates? It's something I'm running into as well. |
And updates? |
any updates? ;] |
Hello all. Sincere apologies for not providing any update on this issue. Thanks for your patience. |
Note: We have seen a similar issue in the past with the |
The fix has been released in v2.11.0 |
New version of django (3.1.1) was released recently. After migrating a project to this version when psycopg2 is trying to register extensions like JSON raises such an error:
TypeError: argument 2 must be a connection, cursor or None when migrate to django 3.1.1. This is not reproduced in django
This issue is not reproduced in django 3.1.
Components that are used in my project are: python==3.6, django==3.1.1 , psycopg2==2.8.6
Here is a stack trace of an error:
The text was updated successfully, but these errors were encountered: