Skip to content

NT escaping in shebang in easy_install #188

@ghost

Description

Originally reported by: Anonymous


Hi.
As far as I can see, there is still escaping of spaces in the shebang in the current version:
https://bitbucket.org/pypa/setuptools/src/0e53d50b76aabfdee7b6166593e41d41a16e6a25/setuptools/command/easy_install.py?at=default#cl-1546
I find this quite unfortunate, as this is of very limited use, but prevents some valid use cases.

The current code quotes all shebang strings that contain spaces. On all POSIX systems that I tried (current Ubuntu, ancient redhat, current OS X) this is illegal and simply doesn't work. Given the name of the function, it seems this was intended for windows NT (?).

However, this escaping prevents valid use cases, for example it doesn't allow the specification of "/bin/env /bin/python". I think there is a workaround for this specific case. However I have a use case where I need a different command to produce the correct python executable. This would be easy, except for the escaping.

If it is possible to detect being on a posix platform (probably not that easy?), we could just skip the escaping, as it is never beneficial. If this is not possible, maybe just skip the escaping all together? The benefit seems very platform specific.

Thanks,
Andy


Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions