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

ImportWarning when importing aiohttp with warnings enabled #3428

Closed
Norrius opened this issue Dec 5, 2018 · 4 comments
Closed

ImportWarning when importing aiohttp with warnings enabled #3428

Norrius opened this issue Dec 5, 2018 · 4 comments

Comments

@Norrius
Copy link

Norrius commented Dec 5, 2018

Long story short

Importing aiohttp results in a lot of ImportWarnings.

While cleaning the app from warnings I noticed that a lot of them stem from aiohttp. To my surprise, simply importing the library results in 10 warning. Of these, DeprecationWarnings are addressed in #3275, but I don't see anything about ImportWarnings.

Expected behaviour

Expected no warnings on library import.

Actual behaviour

ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__

Steps to reproduce

$ python -Wall -c "import aiohttp"
/usr/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
/usr/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
/usr/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
/usr/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
/usr/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
/usr/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
/usr/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
project_root/venv/lib/python3.7/site-packages/aiohttp/multipart.py:8: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Mapping, Sequence, deque
project_root/venv/lib/python3.7/site-packages/aiohttp/multipart.py:8: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Mapping, Sequence, deque
/usr/lib/python3.7/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)

Your environment

Linux Mint 18.3, Python 3.7.1, aiohttp 3.4.4.

@aio-libs-bot
Copy link

GitMate.io thinks the contributor most likely able to help you is @asvetlov.

Possibly related issues are #2301 (pyinstaller cannot import aiohttp), #276 (python crashes on aiohttp import), #2956 (Enable logging when aiohttp.web is used as a program), #2320 (aiohttp-jinja2), and #3044 (Uvloop raises a warning when I use aiohttp.test_utils.loop_context).

@asvetlov
Copy link
Member

asvetlov commented Dec 5, 2018

The problem is fixed on master.
Please wait for a new release

@Norrius
Copy link
Author

Norrius commented Dec 5, 2018

Can confirm that latest master works for me. Thank you.

@Norrius Norrius closed this as completed Dec 5, 2018
@lock
Copy link

lock bot commented Dec 5, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Dec 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants