Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70510

Re: Strange syntax error, occurs only when script is executed directly

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.019
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'subject:error': 0.03; '22,': 0.09; 'required,': 0.09; 'subject:script': 0.09; 'yeah,': 0.09; 'cc:addr:python-list': 0.11; 'enough.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'optional.': 0.16; 'subject:when': 0.16; 'wrote:': 0.18; '(but': 0.19; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'tim': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; '(which': 0.31; 'went': 0.31; 'url:wiki': 0.31; 'chase': 0.31; 'url:wikipedia': 0.31; 'standards': 0.33; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; "didn't": 0.36; 'url:org': 0.36; 'should': 0.36; 'pm,': 0.38; 'that,': 0.38; 'sure': 0.39; 'space': 0.40; 'read': 0.60; 'between': 0.67; 'compliant': 0.68; 'hour': 0.70; 'url:%1': 0.72; 'citation': 0.84; 'researching': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=rryZ4z3wro0tLeobCLhCaFaxrYOqeYEPn+swmiFJDLk=; b=J8rkfh9eynBCoNqD9+grfOxkhgnjSC2LH5pcbFudXTX6d4ceDZHaHmpEbRivTzpkwl vb7uqnpU91Io6H/FKceLrjL50HEJJx5LrNDYo6bFhHwhMt59bozhaiGTNTWAHhD1Wxlt 1P/SajS6DM94njwfrEqBJyMkn/4Cc0vG89RoDDus8iZ/9eyi9T82ExBJ3rp0Kq7iwShu y93+hQnpsJaLbfnKHYl7AkFxZy5tetznT23Q9fVZNPIIcxzBz+Ku0NzFd1PBdHkQnTDY 5H1P3Troq+MWynw8DQO0RscfTJK409oeKVQwev/keO7v7Ij/xBONRWFm6q3yj5qeWXwa G5fQ==
MIME-Version 1.0
X-Received by 10.58.38.166 with SMTP id h6mr8668743vek.22.1398173203820; Tue, 22 Apr 2014 06:26:43 -0700 (PDT)
In-Reply-To <20140422082258.53104558@bigbox.christie.dr>
References <mailman.9431.1398162667.18130.python-list@python.org> <5356625a$0$29993$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmo8_USjq+_rr3xMN-Uv7Si_1BTGLTVZfS+Phf_tJs1y+w@mail.gmail.com> <20140422082258.53104558@bigbox.christie.dr>
Date Tue, 22 Apr 2014 23:26:43 +1000
Subject Re: Strange syntax error, occurs only when script is executed directly
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.9442.1398173207.18130.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1398173207 news.xs4all.nl 2830 [2001:888:2000:d::a6]:41901
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:70510

Show key headers only | View raw


On Tue, Apr 22, 2014 at 11:22 PM, Tim Chase
<python.list@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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Strange syntax error, occurs only when script is executed directly Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-04-22 12:29 +0200
  Re: Strange syntax error, occurs only when script is executed directly Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-04-22 12:36 +0000
    Re: Strange syntax error, occurs only when script is executed directly Chris Angelico <rosuav@gmail.com> - 2014-04-22 22:52 +1000
      Re: Strange syntax error, occurs only when script is executed directly Andrew Cooper <root@127.0.0.1> - 2014-04-23 02:28 +0100
    Re: Strange syntax error, occurs only when script is executed directly Tim Chase <python.list@tim.thechases.com> - 2014-04-22 08:22 -0500
    Re: Strange syntax error, occurs only when script is executed directly Chris Angelico <rosuav@gmail.com> - 2014-04-22 23:26 +1000

csiph-web