Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yarl >= 1.5.0 breaks aiohttp #4880

Closed
kirknorthrop opened this issue Jul 27, 2020 · 6 comments
Closed

Yarl >= 1.5.0 breaks aiohttp #4880

kirknorthrop opened this issue Jul 27, 2020 · 6 comments
Labels
bug reproducer: missing This PR or issue lacks code, which reproduce the problem described or clearly understandable STR

Comments

@kirknorthrop
Copy link

kirknorthrop commented Jul 27, 2020

馃悶 Describe the bug
Breaking change in yarl 1.5.0 breaks aiohttp.

馃挕 To Reproduce
Install aiohttp via pip, then from aiohttp import web

馃挕 Expected behavior
It should import web

馃搵 Logs/tracebacks

 File "/usr/local/lib/python3.7/site-packages/myprojectnamehere/services/application/product_service.py", line 3, in <module>
    from aiohttp import web
  File "/usr/local/lib/python3.7/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import BaseConnector as BaseConnector
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 30, in <module>
    from yarl import URL
  File "/usr/local/lib/python3.7/site-packages/yarl/__init__.py", line 1, in <module>
    from ._url import URL, cache_clear, cache_configure, cache_info
  File "/usr/local/lib/python3.7/site-packages/yarl/_url.py", line 56, in <module>
    @rewrite_module
  File "/usr/local/lib/python3.7/site-packages/yarl/_url.py", line 132, in URL
    _QUERY_PART_QUOTER = _Quoter(safe="?/:@", qs=True, requote=False)
  File "yarl/_quoting.pyx", line 192, in yarl._quoting._Quoter.__init__
TypeError: __init__() got an unexpected keyword argument 'requote'

馃搵 Your version of the Python

python 3.7.4

馃搵 Your version of the aiohttp/yarl/multidict distributions

$ python -m pip show aiohttp
aiohttp==3.6.2
$ python -m pip show multidict
multidict==4.5.2
$ python -m pip show yarl
yarl==1.5.0
@Harmon758
Copy link
Member

This was an issue with yarl's MANIFEST.in that should now be fixed with v1.5.1 of yarl.

@kirknorthrop
Copy link
Author

kirknorthrop commented Aug 3, 2020

Unfortunately, it's not fixed with v1.5.1 of yarl. (Exactly the same error. This is being built in a docker container, so I can see the pip install log from the docker build, and it installs yarl 1.5.1)

@kirknorthrop kirknorthrop changed the title Yarl 1.5.0 breaks aiohttp Yarl >= 1.5.0 breaks aiohttp Aug 3, 2020
@webknjaz webknjaz added the reproducer: missing This PR or issue lacks code, which reproduce the problem described or clearly understandable STR label Aug 4, 2020
@webknjaz
Copy link
Member

webknjaz commented Aug 4, 2020

File "yarl/_quoting.pyx", line 192, in yarl._quoting._Quoter.__init__`

Your traceback refers to yarl/_quoting.pyx that does not exist in YARL 1.5+ so I'm pretty sure there's some mixup in your env. Also, w/o a reproducer there's not much we can do.

@justinaustin
Copy link

justinaustin commented Sep 8, 2020

I am running into this same error on a fresh installation of aiohttp (via dephell). Here's my traceback:

$ python -m dephell --version
Traceback (most recent call last):
  File "/Users/austin/.pyenv/versions/3.6.10/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/austin/.pyenv/versions/3.6.10/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/__main__.py", line 2, in <module>
    from .cli import entrypoint
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/cli.py", line 11, in <module>
    from .commands import COMMANDS
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/commands/__init__.py", line 2, in <module>
    from .discover import COMMANDS
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/commands/discover.py", line 86, in <module>
    module = import_module('.' + module_name, package=package)
  File "/Users/austin/.pyenv/versions/3.6.10/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/commands/deps_add.py", line 7, in <module>
    from ..actions import get_resolver
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/actions/__init__.py", line 7, in <module>
    from ._converting import attach_deps
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/actions/_converting.py", line 7, in <module>
    from ..converters import CONVERTERS
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/converters/__init__.py", line 5, in <module>
    from .base import BaseConverter
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/converters/base.py", line 11, in <module>
    from ..controllers import Graph, Mutator, Resolver
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/controllers/__init__.py", line 3, in <module>
    from ._dependency import DependencyMaker
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/controllers/_dependency.py", line 18, in <module>
    from ..repositories import get_repo
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/repositories/__init__.py", line 2, in <module>
    from ._conda import CondaCloudRepo, CondaGitRepo, CondaRepo
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/repositories/_conda/__init__.py", line 2, in <module>
    from ._cloud import CondaCloudRepo
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/repositories/_conda/_cloud.py", line 24, in <module>
    from ...networking import requests_session
  File "/Users/austin/.local/lib/python3.6/site-packages/dephell/networking.py", line 10, in <module>
    from aiohttp import ClientError, ClientSession, TCPConnector
  File "/Users/austin/.local/lib/python3.6/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import BaseConnector as BaseConnector
  File "/Users/austin/.local/lib/python3.6/site-packages/aiohttp/client.py", line 30, in <module>
    from yarl import URL
  File "/Users/austin/.local/lib/python3.6/site-packages/yarl/__init__.py", line 1, in <module>
    from ._url import URL, cache_clear, cache_configure, cache_info
  File "/Users/austin/.local/lib/python3.6/site-packages/yarl/_url.py", line 56, in <module>
    @rewrite_module
  File "/Users/austin/.local/lib/python3.6/site-packages/yarl/_url.py", line 132, in URL
    _QUERY_PART_QUOTER = _Quoter(safe="?/:@", qs=True, requote=False)
  File "yarl/_quoting.pyx", line 192, in yarl._quoting._Quoter.__init__
TypeError: __init__() got an unexpected keyword argument 'requote'

My environment contains aiohttp==3.6.2 and yarl==1.5.1.

I can also confirm that installing yarl==1.4.2 fixes this issue for me

@webknjaz
Copy link
Member

webknjaz commented Sep 9, 2020

@justinaustin please post a complete reproducer to aio-libs/yarl#485 and we'll try to take a look. Nobody's been able to reproduce it so far. Also, your traceback tells us almost nothing about your env, only that you use pyenv and used --user with pip.

@Harmon758
Copy link
Member

This is late, but since there's still some discord.py users encountering this issue:

Since, it's possible that force reinstalling v1.5.0 even without using the cache can fail, I think it's plausible that this is because there are files that are mistakenly no longer associated with the library by pip that will not be uninstalled during the reinstall. This means that it's also possible that upgrading from v1.5.0 to v1.5.1 will not fix the issue, since those files will not be uninstalled during the upgrade process either.

Since yarl v1.4.2's MANIFEST.in is correct, downgrading to yarl v1.4.2 fixes the issue.
Additionally, there should be no issue with upgrading to a version of yarl > 1.5.0 (e.g. v1.5.1) afterwards, since the incorrect MANIFEST.in in v1.5.0 would be skipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug reproducer: missing This PR or issue lacks code, which reproduce the problem described or clearly understandable STR
Projects
None yet
Development

No branches or pull requests

4 participants