Strange syntax error, occurs only when script is executed directly

Chris Angelico rosuav at gmail.com
Tue Apr 22 09:26:43 EDT 2014


On Tue, Apr 22, 2014 at 11:22 PM, Tim Chase
<python.list at tim.thechases.com> wrote:
> On 2014-04-22 22:52, Chris Angelico wrote:
>> I'm pretty sure the POSIX standard stipulates that a space there is
>> optional. Should be no difference between "#!/" and "#! /" on any
>> compliant OS. (But I can't right now find a citation for that, so I
>> may be wrong.)
>
> I wondered this too, so went researching and found this:
>
>   http://en.wikipedia.org/wiki/Shebang_%28Unix%29#Magic_number
>
> which said that there was actually some contention that the space was
> required, but that the specs state that both with-and-without are
> permissible.

Yeah, I read the Wikipedia page, but was looking for a citable
standards document, and didn't find one. (Which may just mean I didn't
look hard enough. Wasn't going to spend an hour on it.)

ChrisA



More information about the Python-list mailing list