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

Invalid syntax #3521

Closed
nn-user opened this issue Jan 11, 2019 · 4 comments
Closed

Invalid syntax #3521

nn-user opened this issue Jan 11, 2019 · 4 comments

Comments

@nn-user
Copy link

nn-user commented Jan 11, 2019

Long story short

Traceback (most recent call last):
  File "main.py", line 1, in <module>
    import aiohttp
  File "/usr/local/lib/python3.7/dist-packages/aiohttp/__init__.py", line 10, in <module>
    from .protocol import *  # noqa
  File "/usr/local/lib/python3.7/dist-packages/aiohttp/protocol.py", line 18, in <module>
    from .helpers import reify
  File "/usr/local/lib/python3.7/dist-packages/aiohttp/helpers.py", line 25
    ensure_future = asyncio.async
                                ^
SyntaxError: invalid syntax
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "checker.py", line 1, in <module>
    import aiohttp
  File "/usr/local/lib/python3.7/dist-packages/aiohttp/__init__.py", line 10, in <module>
    from .protocol import *  # noqa
  File "/usr/local/lib/python3.7/dist-packages/aiohttp/protocol.py", line 18, in <module>
    from .helpers import reify
  File "/usr/local/lib/python3.7/dist-packages/aiohttp/helpers.py", line 25
    ensure_future = asyncio.async

Expected behaviour

Not crash my script

Actual behaviour

Crash, not worked with python3.7

Steps to reproduce

Used module aiohttp

Your environment

I use this module in my program, but after the update it stopped working

@aio-libs-bot
Copy link

GitMate.io thinks possibly related issues are #591 (docs syntax highlighting missing), #659 (Invalid Header stops processing Body?), #2683 (CookieError on invalid cookie names), #1396 (bug with invalid redir), and #2773 ("InvalidStateError: invalid state" when data is chunked).

@Harmon758
Copy link
Member

What version of aiohttp are you using?
This specific issue was fixed in v2.3.3 with 7e15124 more than a year ago.
Anything resembling this line was removed in v3.0.0 with 1a606bc when Python 3.4 support was dropped.
Please make sure you're up to date with the latest development version when submitting issues.

@nn-user
Copy link
Author

nn-user commented Jan 11, 2019

Understood the reason, sorry to bother you.

@nn-user nn-user closed this as completed Jan 11, 2019
@lock
Copy link

lock bot commented Jan 11, 2020

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 Jan 11, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 11, 2020
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