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 when registering ForwardRefs in python 3.10.2 & 3.9.10 #504
Comments
Python 3.9.10 Changelog: |
I can confirm this bug. There's no way to specify an older 3.9/3.10 version on GitHub Actions (e.g. 3.9.9) so we're kinda stuck on this one until it's fixed here :/ |
Good news: this has already been fixed in requests-cache 0.9.1 (see #501). I opened that |
That definitely helped. Thanks for the assistance! |
Due to some changes very high up the stack in CPython 3.9.10 [1], requests-cache does no longer work properly [2] and will fail due to its dependency on cattrs [3] which uses functools.singledispatch which is what changed in the aforementioned CPython update. The requests-cache devs have implemented a workaround in version 0.9.1 which is the only thing that they can do since cattrs does not explicitly support their usage (and are not willing to implement a workaround at their level). This commit upgrades to said version. [1] https://bugs.python.org/issue46032 [2] requests-cache/requests-cache#504 [3] python-attrs/cattrs#206
The problem
TypeError: Invalid first argument to `register()`. ForwardRef('CachedResponse') is not a class.
Since requests-cache is using cattr as serializers (https://github.com/reclosedev/requests-cache/blob/master/requests_cache/serializers/cattrs.py) this issue is related.
Looks like there is already an issue open for cattr regarding this error but a workaround would be nice until python is patched (if they even patch?).
issue: python-attrs/cattrs#206
Expected behavior
-||-
Steps to reproduce the behavior
Start any application utilizing requests-cache
Workarounds
python-attrs/cattrs#206
Environment
The text was updated successfully, but these errors were encountered: