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

Not sure if bug, but buildout fails to install a package with \r\n end of line characters. #130

Closed
benwah opened this issue Jul 2, 2013 · 3 comments · Fixed by #150

Comments

@benwah
Copy link

commented Jul 2, 2013

Python version: 2.6.5

Develop: '[...]/downloads/sorl-thumbnail'
Traceback (most recent call last):
  File "/tmp/tmpD5YZcm", line 13, in <module>
    exec(compile(open('[...]/downloads/sorl-thumbnail/setup.py').read(), '[...]/downloads/sorl-thumbnail/setup.py', 'exec'))
  File "[...]/downloads/sorl-thumbnail/setup.py", line 2
    from setuptools import setup, find_packages
                                               ^
SyntaxError: invalid syntax

How I fixed it:

(In buildout 2.1.0), zc/buildout/easy_install.py, line 1251

exec(compile(open(%(setup)r).read(), %(setup)r, 'exec'))

Changed to:

exec(compile(open(%(setup)r).read().replace('\\r\\n', '\\n'), %(setup)r, 'exec'))
@mgedmin

This comment has been minimized.

Copy link
Member

commented Jul 2, 2013

Suggested alternative fix:

exec(compile(open(%(setup)r, 'U').read(), %(setup)r, 'exec'))

FWIW Python 2.7 doesn't complain about \r's in strings passed to compile(), so this only affects 2.6.

@benwah

This comment has been minimized.

Copy link
Author

commented Oct 21, 2013

Your fix works for me on Python 2.6.

tseaver added a commit that referenced this issue Oct 22, 2013
Fixes #130.
@pombredanne

This comment has been minimized.

Copy link
Contributor

commented Oct 25, 2013

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.