On 9/03/2011 1:43 PM, Glenn Linderman wrote:
I'm of the opinion that attempting to parse a Unix #! line, and intuit
what would be the equivalent on Windows is unnecessarily complex and
error prone, and assumes that the variant systems are configured using
the same guidelines (which the Python community may espouse, but may not
be followed by all distributions, sysadmins, or users). That's why I
propose a different line for Windows... it is as simple as the
long-proven Unix #! line, but imposes no restrictions on or requirements
that there be a #! line; it has more flexibility in that it could invoke
different versions or provide different options on Unix and Windows if
necessary for some environments.
#!/usr/bin/env python2.6 -B
#@c:\python26\python2.6.exe
or
#!/usr/bin/python2.5
#@"C:\Program Files (x86)\IronPython 2.6 for .NET 4.0\ipy.exe"
I don't think that buys us much. A script with "#!/usr/bin/env python"
could be distributed with an expectation it will work across various
different machines (and possibly even different operating systems). A
script with "c:\..." could not be distributed and expected to work
reliably anywhere. ie, any script with a #! line (or even a #@ line)
with a fully qualified Windows path can only be expected to work on a
single machine - so there is no need to support both #! and #@ as the
script is not even cross-machine portable, let alone cross-platform
portable.
The only way to expect a #! line to work across machines would be to
have a "virtual" path - eg just "python2.6" without any path specifier
at all. In that case, I see no problem with reusing the #! from *nix
systems and treating "/usr/bin" etc as a "virtual" specifier on Windows.
If people find a need on Windows to add a fully-qualified path to this
line (whatever the spelling), they are implicitly saying this script
works only on the current machine.
IOW, as soon as someone has:
#!/usr/bin/env python2.6 -B
#@c:\python26\python2.6.exe
in their script, the script is targeted at exactly 1 specific machine,
so why not just reuse the #! syntax? OTOH, if an existing script has:
#!/usr/bin/env python2.6 -B
They are attempting to declare in a portable way that Python 2.6 is
necessary - so why force them to add a #@ line to make it work on
Windows when the #! line is the only clue Windows needs to make it work
automagically?
Cheers,
Mark
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com