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
Closed

Comments

@benwah
Copy link

benwah 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
Copy link
Member

mgedmin 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
Copy link
Author

benwah commented Oct 21, 2013

Your fix works for me on Python 2.6.

@pombredanne
Copy link
Contributor

1

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

Successfully merging a pull request may close this issue.

3 participants