Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
setup.py develop fails with some packages on Python3 #218
Originally reported by: alex_gaynor (Bitbucket: alex_gaynor, GitHub: Unknown)
Instructions for reproduction:
$ git clone git://git.openstack.org/openstack/python-swiftclient.git $ cd python-swiftclient $ virtualenv -p python3.3 foo $ ./foo/bin/pip install -U -r requirements.txt setuptools==4.0.1 $ . foo/bin/activate $ python setup.py develop
This appears to have been introduced with the 4.0.0 release. Upstream ticket that noticed this issue: https://bugs.launchpad.net/python-swiftclient/+bug/1326972
Tail end of the traceback is:
I guess it's no surprise that when #210 was changed, it created this regression.
My initial instinct is to roll back the change that introduced the issue. I welcome alternative suggestions and especially welcome unit tests that capture these requirements.
Can we special case python3 or Windows for this?
The reasonning is that on windows the binary script must be open in binary. My initial naive approach breaks because in this part of the code, we still assume that the contents of scripts can only be text.
On unix, this doesn't break because text mode files are not converted, handling binary equally. But then Python3 tells us bytes are is not text...
Maybe we should call is_python_script() to choose the binary flag in the install_egg_scripts in develop command?
I will experiment and issue a pull request.