question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SyntaxError around async keyword on Python 3.7

See original GitHub issue

async cannot be used as an argument name in Python 3.7:

https://github.com/kennethreitz/pipenv/blob/d89696e36da1277067c055ca83f786f762f02091/pipenv/vendor/pexpect/spawnbase.py#L224

Describe you environment
  1. OS Type: Alpine Linux 3.6
  2. Python version: 3.7-rc
  3. Pipenv version: N/A
Expected result

I can install pipenv.

Actual result
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 7, in <module>
    from pipenv import cli
  File "/usr/local/lib/python3.7/site-packages/pipenv/__init__.py", line 17, in <module>
    from .cli import cli
  File "/usr/local/lib/python3.7/site-packages/pipenv/cli.py", line 19, in <module>
    import delegator
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/delegator.py", line 8, in <module>
    from pexpect.popen_spawn import PopenSpawn
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/__init__.py", line 75, in <module>
    from .pty_spawn import spawn, spawnu
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/pty_spawn.py", line 14, in <module>
    from .spawnbase import SpawnBase
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/spawnbase.py", line 224
    def expect(self, pattern, timeout=-1, searchwindowsize=-1, async=False):
                                                                   ^
SyntaxError: invalid syntax
Steps to replicate

pip install pipenv with Python 3.7.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
erinxoconcommented, Oct 24, 2017

This is fixed on master by PR #962

1reaction
nateprewittcommented, Oct 23, 2017

I closed #957 because I don’t think we want the noise from tests failing until 3.7 is at least into a beta phase. I’ll get pexpect updated tonight. Thanks everyone!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python 3.7 syntax error: async is a reserved keyword #4849
Module is named async. More info. I fail to run 3.7 test easily, but this leads to: File "celery/backends/redis.py ...
Read more >
Async def invalid syntax - Discussions on Python.org
Hello, today I copied bot from GitHub, but when I wanted to run that bot so it throw this error: File "/home/Bot/bot.py", line...
Read more >
Python [Invalid syntax] with async def - Stack Overflow
If you receive a SyntaxError , it means you're using an older ... The async and await keywords are only valid for Python...
Read more >
SyntaxError regarding async when attempting to run Jupyter in ...
Yes, the issue is occurring because async was added as a reserved keyword in Python 3.7. When you import pexpect , it's importing...
Read more >
Invalid Syntax in Python: Common Reasons for SyntaxError
For example, in Python 3.6 you could use await as a variable name or function name, but as of Python 3.7, that word...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found