Hide Forgot
Issue also present in RHEL 6. $ rpm -q python-setuptools > python-setuptools-0.6.10-3.el6.noarch +++ This bug was initially created as a clone of Bug #1353934 +++ See https://github.com/pypa/setuptools/issues/188 This prevents equivalent of https://pkgs.fedoraproject.org/cgit/rpms/clufter.git/tree/clufter.spec?id=8c9ee7115ce2b5f25eeefc7e0247a1f3128e9662#n127 i.e., > # make Python interpreter executation sane (via -Es flags) > %{__python2} setup.py saveopts -f setup.cfg build_scripts \ > "--executable=%{__python2} -Es" from working properly in RHEL 7, simply because the generated shebang reads: > #!"/usr/bin/python2 -Es" which is indeed invalid. As an aside, I think it would be reasonable to have setuptools (and friends) patched to the same effect (as opposed to patching every and each package defining console_scripts in setup.py) as a sane (and supportable!) default.
Is there some simple way to reproduce the issue?
Yes, grab a setup.py using (and setuptools-compatible) package that defines "console_scripts" there (clufter in my case) and run: # python setup.py saveopts -f setup.cfg build_scripts \ "--executable=python -Es" # python setup.py build # python setup.py install Then, observe the scripts from console_scripts definition cannot be run because of malformed shebang.
(forgot to drop needinfo flag)
Unfortunately as Michal already pointed out (see bug 1353934) there have been way too many changes upstream when the fix was implemented, so currently a backport of the fix is impossible without refactoring a lot of the relevant setuptools code. This would be a very invasive change on the way that shebangs are being generated currently, so in this case there is an elevated risk that the current working shebang generation will break (or break other working corner cases), just to fix this specific corner case. In this particular situation that you reported it would be preferable that the workaround is being used at the individual components, rather than fixing setuptools itself. Closing it as WONTFIX.