aiohttp version 3.8.0 throws SyntaxError on import
aaraney opened this issue · comments
The problem
aiohttp
version 3.8.0
, released on 11/31/21, causes SyntaxError
. It is related to usage of the python-forge
package.
Steps to reproduce the behavior
pip install -U aiohttp-client-cache
import aiohttp_client_cache
>'base_url:typing.Union[str, yarl.URL, NoneType]=None' of kind 'POSITIONAL_OR_KEYWORD' follows 'cache:CacheBackend=None' of kind 'KEYWORD_ONLY'
Traceback (most recent call last):
File "/Users/araney/github/test_hydrotools/venv/lib/python3.8/site-packages/aiohttp_client_cache/docs/forge_utils.py", line 32, in wrapper
return revision(target_function)
File "/Users/araney/github/test_hydrotools/venv/lib/python3.8/site-packages/forge/_revision.py", line 330, in __call__
next_.validate()
File "/Users/araney/github/test_hydrotools/venv/lib/python3.8/site-packages/forge/_signature.py", line 1344, in validate
raise SyntaxError(
SyntaxError: 'base_url:typing.Union[str, yarl.URL, NoneType]=None' of kind 'POSITIONAL_OR_KEYWORD' follows 'cache:CacheBackend=None' of kind 'KEYWORD_ONLY'
Environment
- aiohttp-client-cache version: [e.g.
0.5.1
] - Python version: [e.g.
3.8.10
] - Platform: [e.g. MacOSX 11.5.2]
Thanks for reporting! Looks like a new base_url
param was added in aio-libs/aiohttp#6129, and for some reason it's positional-or-keyword instead of keyword-only like the rest of the params. I'll get that fixed shortly.
Awesome! Thanks and cheers!
@aaraney Done! This is fixed in 0.5.2.
Fantastic! Thanks @JWCook!!