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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken aiohttp version in rewrite #1280

Closed
Khoyo opened this issue May 11, 2018 · 4 comments
Closed

Broken aiohttp version in rewrite #1280

Khoyo opened this issue May 11, 2018 · 4 comments

Comments

@Khoyo
Copy link

Khoyo commented May 11, 2018

I think that the aiohttp dependency version is broken in rewrite.

The following Dockerfile produces the following traceback when the container is run (src/app.py simply import discord):

FROM python:3.6-alpine3.7

RUN wget 'https://github.com/Rapptz/discord.py/archive/rewrite.tar.gz' -O /tmp/discord.py.tar.gz

RUN pip install /tmp/discord.py.tar.gz

#RUN pip install --upgrade aiohttp

COPY src src

CMD python /src/app.py
Traceback (most recent call last):
  File "/src/app.py", line 1, in <module>
    import discord
  File "/usr/local/lib/python3.6/site-packages/discord/__init__.py", line 20, in <module>
    from .client import Client, AppInfo
  File "/usr/local/lib/python3.6/site-packages/discord/client.py", line 30, in <module>
    from .guild import Guild
  File "/usr/local/lib/python3.6/site-packages/discord/guild.py", line 39, in <module>
    from .channel import *
  File "/usr/local/lib/python3.6/site-packages/discord/channel.py", line 31, in <module>
    from .webhook import Webhook
  File "/usr/local/lib/python3.6/site-packages/discord/webhook.py", line 27, in <module>
    import aiohttp
  File "/usr/local/lib/python3.6/site-packages/aiohttp/__init__.py", line 6, in <module>
    from .client import *  # noqa
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client.py", line 15, in <module>
    from . import connector as connector_mod
  File "/usr/local/lib/python3.6/site-packages/aiohttp/connector.py", line 17, in <module>
    from .client_proto import ResponseHandler
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client_proto.py", line 6, in <module>
    from .http import HttpResponseParser, StreamWriter
  File "/usr/local/lib/python3.6/site-packages/aiohttp/http.py", line 8, in <module>
    from .http_parser import (HttpParser, HttpRequestParser, HttpResponseParser,
  File "/usr/local/lib/python3.6/site-packages/aiohttp/http_parser.py", line 15, in <module>
    from .http_writer import HttpVersion, HttpVersion10
  File "/usr/local/lib/python3.6/site-packages/aiohttp/http_writer.py", line 304, in <module>
    class URL(yarl.URL):
  File "/usr/local/lib/python3.6/site-packages/yarl/__init__.py", line 232, in __init_subclass__
    "is forbidden".format(cls))
TypeError: Inheritance a class <class 'aiohttp.http_writer.URL'> from URL is forbidden

Upgrading aiohttp after the install to the most recent version resolves the issue, but the build warns that discord-py 1.0.0a0 has requirement aiohttp<2.3.0,>=2.0.0, but you'll have aiohttp 3.2.1 which is incompatible.

@fourjr
Copy link
Contributor

fourjr commented May 11, 2018

Getting this error?

TypeError: Inheritance a class <class 'aiohttp.http_writer.URL'> from URL is forbidden

This is due to yarl 1.2 having a breaking change that breaks aiohttp. Downgrade your yarl using pip install -U "yarl<1.2"

@xaviergmail
Copy link

In relation to fourjr's answer above, it may be necessary to downgrade even further pip install "yarl<1" otherwise you'll encounter a different error.

Reference: aio-libs/aiohttp#2662

@ghost
Copy link

ghost commented Jun 7, 2018

It may also be worth noting that you can reinstall aiohttp to the most recent version with zero issues instead.

Been running three bots on rewrite for the past month and have yet to come across a problem with this.

#892 seems to suggest the author is against updating, however.

@Rapptz
Copy link
Owner

Rapptz commented Jun 11, 2018

Fixed by bumping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants