Closed AnyByte closed 12 months ago
It seems like in Python 3.9
https://github.com/django/asgiref/blob/ebb1edbb222afe7775e79927cafd2025c78d971a/asgiref/sync.py#L12-L25
imports Generic
that doesn't support non-type variables like:
https://github.com/django/asgiref/blob/ebb1edbb222afe7775e79927cafd2025c78d971a/asgiref/sync.py#L113
We have a compatibility fix in place for this already - the _P
, a ParamSpec, is what it's complaining about, but if you run the file under 3.9 or earlier then it uses a compatibility shim:
https://github.com/django/asgiref/blob/main/asgiref/sync.py#L30-L33
I suspect the PyCharm debugger has something to do with this failing, and unfortunately since it's a commercial product, I'm not willing to spend too much time working out exactly why it is failing. If you or someone else can work out a fix that doesn't break compatibility with other runtimes, I'm happy to apply it, but unfortunately I don't think we can solve this at the project level, so I'm going to close this for now.
Got this error only while debugging my Django application in Docker container with Pycharm. When debugging locally with Pycharm or starting application normally with Pycharm in Docker the error does not appear.
Python 3.9
Django==4.2.6 asgiref==3.7.2 Pycharm 2023.2.3 Pro
Log: