Closed YossiTamari closed 1 year ago
Hi,
This is a pycharm bug, I'm not sure how can we fix this our side. The falcon library is not doing that anywhere.
A collegue of mine already reported it on pycharm side https://youtrack.jetbrains.com/issue/PY-54853
At least in PyCharm, when running in debug mode (so with Type Checking on), in Python 3.10 specifically, importing falcon adds a a property called
dict
to Python'scollections
. The property is a dict of media type handlers. That causes a crash later whencollections
tries to dodict(...)
. (Tested in Falcon 3.1.0:falcon-3.1.0-cp310-cp310-macosx_10_15_x86_64.whl
)To reproduce simply debug this code:
The output when running with a debugger is:
When running without a debugger it correctly raises
AttributeError: module 'collections' has no attribute 'dict'
Additional Information: This seems to happen inside
falcon/__init__.py
in the call tofrom falcon.app import API
. Putting a breakpoint insidefalcon.app
did not work. For some reason, the debugger would not stop there.