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 installing 19.1.1 on Python 2.7.8 #860

Closed
andreif opened this issue Aug 20, 2014 · 12 comments
Closed

SyntaxError installing 19.1.1 on Python 2.7.8 #860

andreif opened this issue Aug 20, 2014 · 12 comments

Comments

@andreif
Copy link

andreif commented Aug 20, 2014

Seems to be installed but it would be nice without the error message

Compiling /Users/andrei/.pyenv/versions/appmeny/build/gunicorn/gunicorn/workers/_gaiohttp.py ...
  File "/Users/andrei/.pyenv/versions/appmeny/build/gunicorn/gunicorn/workers/_gaiohttp.py", line 64
    yield from self.wsgi.close()
             ^
SyntaxError: invalid syntax

Successfully installed gunicorn
Cleaning up...
@benoitc
Copy link
Owner

benoitc commented Aug 21, 2014

Actually this is an issue in pip: pypa/pip#1954 related to pypa/pip#1873 . Would be cool if at least pip would ignore such error...

@berkerpeksag
Copy link
Collaborator

I've opened pypa/pip#1984 to fix this.

@benoitc
Copy link
Owner

benoitc commented Aug 21, 2014

@berkerpeksag thanks!

@berkerpeksag
Copy link
Collaborator

I've opened pypa/pip#1984 to fix this.

The patch has been merged into master. I will also commit the patch in http://bugs.python.org/issue21338 and will create a similar patch for py_compile for Python 3.5.

So I think we can close this issue now.

@mattrobenolt
Copy link
Contributor

Using python 2.7.6:

For me using pip master (pypa/pip@4411d86), I get half of the error message.

My exact output when installing is:

$ pip install gunicorn
DEPRECATION: --download-cache has been deprecated and will be removed in the future. Pip now automatically uses and configures its cache.
Downloading/unpacking gunicorn
  Downloading gunicorn-19.1.1-py2.py3-none-any.whl (104kB)
    100% |################################| 106kB 1.8MB/s
Installing collected packages: gunicorn
Compiling /Users/matt/.virtualenvs/pip/build/gunicorn/gunicorn/workers/_gaiohttp.py ...
  File "/Users/matt/.virtualenvs/pip/build/gunicorn/gunicorn/workers/_gaiohttp.py", line 64
    yield from self.wsgi.close()
             ^

Successfully installed gunicorn
Cleaning up...

So it has stripped the SyntaxError line but not the stack trace.

Comparing to pip 1.5.6, I see the full thing:

$ pip install gunicorn
Downloading/unpacking gunicorn
  Using download cache from /Users/matt/Library/Caches/pip-downloads/https%3A%2F%2Fpypi.python.org%2Fpackages%2F2.7%2Fg%2Fgunicorn%2Fgunicorn-19.1.1-py2.py3-none-any.whl
Installing collected packages: gunicorn
Compiling /Users/matt/.virtualenvs/pip/build/gunicorn/gunicorn/workers/_gaiohttp.py ...
  File "/Users/matt/.virtualenvs/pip/build/gunicorn/gunicorn/workers/_gaiohttp.py", line 64
    yield from self.wsgi.close()
             ^
SyntaxError: invalid syntax

Successfully installed gunicorn
Cleaning up...

@berkerpeksag
Copy link
Collaborator

I will also commit the patch in http://bugs.python.org/issue21338 and will create a similar patch for py_compile for Python 3.5.

Done: https://hg.python.org/cpython/rev/34436ae65523

@tilgovi
Copy link
Collaborator

tilgovi commented Oct 15, 2014

Thanks, @berkerpeksag 🏆
I've already seen this confuse people setting up projects that install gunicorn as a dependency.

@radzhome
Copy link

The real problem I think is that if someone runs pip install gunicorn -U right now, they will get this faulty version that doesn't install

@tilgovi
Copy link
Collaborator

tilgovi commented Oct 29, 2014

@radlws it does install.

@kmwenja
Copy link

kmwenja commented Dec 18, 2014

I'm still getting this with pip 1.5.4, python 2.7.6, gunicorn 19.1.1
wat's the recommended fix?

@benoitc
Copy link
Owner

benoitc commented Dec 18, 2014

Syntax errors there are harmless. You don't have to really care about it.

@kmwenja
Copy link

kmwenja commented Dec 18, 2014

Thanks

uqs pushed a commit to freebsd/freebsd-ports that referenced this issue Dec 27, 2015
- Update PORTVERSION and distinfo checksum (19.4.1)
- Match COMMENT to setup.py:description=
- Add LICENSE_FILE
- Options: Rename SETPROC option -> Add PROCTITLE to defaults
- Options: Add GAIOHTTP async worker
- Options: Update all descriptions
- Options: Remove TESTS optionjs
- Enable "concurrent" Python support
- Add NO_ARCH (architecture independent package)
- Rename test target to new conventions
- Check, limit, and add BROKEN message for Option/Python version
  combinations that aren't supported.
- Patch out non-compulsory dependencies from test requirements file
- Delete requirements_dev.txt patch file (no longer necessary)

- Add post-patch: target to remove _gaiohttp.py, because compileall() of this file
  fails on 2.x with a SyntaxError, but is not handled, so .py[co] files references
  are added to --record output, breaking file list generation. [1][2][3][4][5]

Changes:

  http://docs.gunicorn.org/en/stable/news.html

[1] benoitc/gunicorn#788
[2] benoitc/gunicorn#860
[3] benoitc/gunicorn#982
[4] pypa/pip#1873
[5] pypa/pip#1954


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@404558 35697150-7ecd-e111-bb59-0022644237b5
koobs added a commit to freebsd/freebsd-ports that referenced this issue Dec 27, 2015
- Update PORTVERSION and distinfo checksum (19.4.1)
- Match COMMENT to setup.py:description=
- Add LICENSE_FILE
- Options: Rename SETPROC option -> Add PROCTITLE to defaults
- Options: Add GAIOHTTP async worker
- Options: Update all descriptions
- Options: Remove TESTS optionjs
- Enable "concurrent" Python support
- Add NO_ARCH (architecture independent package)
- Rename test target to new conventions
- Check, limit, and add BROKEN message for Option/Python version
  combinations that aren't supported.
- Patch out non-compulsory dependencies from test requirements file
- Delete requirements_dev.txt patch file (no longer necessary)

- Add post-patch: target to remove _gaiohttp.py, because compileall() of this file
  fails on 2.x with a SyntaxError, but is not handled, so .py[co] files references
  are added to --record output, breaking file list generation. [1][2][3][4][5]

Changes:

  http://docs.gunicorn.org/en/stable/news.html

[1] benoitc/gunicorn#788
[2] benoitc/gunicorn#860
[3] benoitc/gunicorn#982
[4] pypa/pip#1873
[5] pypa/pip#1954
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

7 participants