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

SyntaxError around async keyword on Python 3.7 #956

Closed
jacebrowning opened this issue Oct 23, 2017 · 8 comments · Fixed by #962
Closed

SyntaxError around async keyword on Python 3.7 #956

jacebrowning opened this issue Oct 23, 2017 · 8 comments · Fixed by #962

Comments

@jacebrowning
Copy link
Contributor

jacebrowning commented Oct 23, 2017

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.

@AlJohri
Copy link
Contributor

AlJohri commented Oct 23, 2017

This should be raised on https://github.com/pexpect/pexpect/ I imagine this change in 3.7 is going to break a whole lot of code though.

jacebrowning referenced this issue in jacebrowning/pipenv Oct 23, 2017
@jacebrowning
Copy link
Contributor Author

It looks like they have already fixed this issue upstream (async => async_): https://github.com/pexpect/pexpect/blob/c741080a46445e5b2dec037c4856617f679d4546/pexpect/spawnbase.py

@jacebrowning
Copy link
Contributor Author

So I think the vendored pexpect just needs to be updated.

@nateprewitt
Copy link
Sponsor Member

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!

erinxocon added a commit that referenced this issue Oct 24, 2017
update the vendored pexpect for python 3.7 async support to fix #956
@erinxocon
Copy link
Contributor

This is fixed on master by PR #962

@nayanmshah
Copy link

I am facing the same issue as well. Please advise.

@tomanizer
Copy link

the async as variable issue also breaks apache-airflow on python 3.7.

@uranusjr
Copy link
Member

uranusjr commented Aug 4, 2018

The pexpect issue has been fixed long ago. If you see this exact problem, you should upgrade Pipenv. If Pipenv is already up-to-date, or if you’re experiencing this for a package you want to install with Pipenv, this is a problem of that package, not Pipenv. Please report this problem to them instead.

Locking this since the problem is obviously resolved, and any claim of having this exact issue is always wrong.

@pypa pypa locked as resolved and limited conversation to collaborators Aug 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants