(original) (raw)

On 7/20/2011 11:35 PM, Mark Hammond wrote:
Virtual commands in shebang lines:

Virtual Commands are shebang lines which start with strings which would
be expected to work on Unix platforms - examples include
'/usr/bin/python', '/usr/bin/env python' and 'python'. Optionally, the
virtual command may be suffixed with a version qualifier (see below),
such as '/usr/bin/python2' or '/usr/bin/python3.2'. The command executed
is based on the rules described in Python Version Qualifiers below.





I note in passing that '/usr/bin/env python' is hard-coded in the
launcher, which conforms to the above documentation. But there is
no hard requirement in Unix, if I correctly understand it, that
'/usr/bin/env' be separated from 'python' (or whatever) by exactly
one space. While I doubt it is frequently used with other than a
single space, I think it would be legal to have 2 or 3 or 10 spaces,
and maybe even tabs or a mixture, and it would work on Unix... but
not in the launcher.



It would somewhat complicate the launcher code to have an additional
case to check for /usr/bin/env, skip following white space, and then
compare to python, but it would be more robust.



If it is thought that hard-coding a single space covers most of the
uses, it should at least be emphasized in the documentation that
only commands of than nature containing a single space will work
with the launcher.