Path: csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(at': 0.03; 'removes': 0.05; 'bash': 0.07; 'convention.': 0.07; 'newline': 0.07; 'reason,': 0.07; 'trailing': 0.07; 'subject:Windows': 0.09; 'python': 0.09; '22,': 0.09; 'follows.': 0.09; 'friday,': 0.09; '(and,': 0.16; 'both,': 0.16; 'carriage': 0.16; 'chmod': 0.16; 'complained': 0.16; 'decent': 0.16; 'newlines': 0.16; 'resolved:': 0.16; 'skip:[ 60': 0.16; 'unix-style': 0.16; 'windows?': 0.16; 'wrote:': 0.17; 'message-----': 0.17; 'platforms': 0.18; 'windows': 0.19; 'feb': 0.19; 'latter': 0.22; 'installed': 0.23; 'tried': 0.25; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; "doesn't": 0.28; 'run': 0.28; 'equivalent.': 0.29; 'url:mailman': 0.29; 'usually': 0.30; 'url:python': 0.32; 'file': 0.32; 'sources': 0.32; 'running': 0.32; 'skip:- 10': 0.32; 'url:listinfo': 0.32; 'to:addr:python- list': 0.33; 'text': 0.34; 'pm,': 0.35; 'subject:?': 0.35; 'subject:': 0.36; 'but': 0.36; 'url:org': 0.36; 'email addr:python.org': 0.36; 'editor': 0.37; 'does': 0.37; 'maintaining': 0.37; 'sent:': 0.37; 'subject:: ': 0.38; 'from:': 0.38; 'easier': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'end': 0.40; 'url:mail': 0.40; 'email name:python-list': 0.62; 'benefit': 0.70; 'received:74.208': 0.71; '2013': 0.84; 'ware': 0.91; 'response,': 0.93 Date: Mon, 25 Feb 2013 08:14:36 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Shebang line on Windows? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:I3/skK+NFy+VdHPBcq1h+v/B0uca3ilI1Tdim7T0GEU 6wbGUcTA+bhHlPqWecMlh3KNF8o7L/f5X32HwoBpTdEn50PdJX F6xo80frkNVA456Xr1gviCoHRIq4Rm7Q6O9vY4DdSMo2J5rSlA GcRsyf6de+3fFDA911xo4KnuT80+eykGnWFxwNlfqqzWlXRt6w OFdCZGIYsr791LEuYezg/FkW/oSko/esens0ycD8FKDfrI5nXf u5qWApKoT0jZv2AkjZH1+1A13FZ//GWu76eIoiubMXTymtg3tD lviX0AN9Mh5hXakDWOqfgLqPX2e+O1NTlUy9veVR6gCZLiKDA= = X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361798104 news.xs4all.nl 6973 [2001:888:2000:d::a6]:40527 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39890 > -----Original Message----- > From: Python-list [mailto:python-list-bounces+frsells=adventistcare.org@python.org] On Behalf Of James Harris > Sent: Friday, February 22, 2013 5:53 PM > To: python-list@python.org > Subject: Re: Shebang line on Windows? > > On Feb 22, 6:40 pm, Zachary Ware > > A word of warning unless this has since been resolved: Whenever I have tried adding the shebang line on Windows and running it on Unix the latter has complained about the carriage return at the end of the line. This means that Unix does not work when invoked as follows. > (And, yes, the file has had chmod +x applied.) > > ./program.py > > It is, of course, OK when run as > > python program.py > > but that removes some of the benefit of the shebang line. > > James > -- > http://mail.python.org/mailman/listinfo/python-list > (Fixing top-posted response, so it comes after the part it is quoting) On 02/25/2013 07:35 AM, Sells, Fred wrote: > When moving from windows to unix you need to run "dos2unix" on any > programs that use shebang (at least with python 2.6) that is > installed on some platforms but must be installed on others like > CentOs but it is in their repository. > It's not Python that needs dos2unix, it's bash or equivalent. For some reason, bash shebang processing still isn't tolerant of a trailing cr on the line. Python doesn't care. If someone is maintaining sources that need to run on both, it's easier to maintain them using Unix-style newlines. All it usually requires is a decent Windows text editor that honors the existing newline convention. Or better that can be configured to always use simple newlines at end of each line. -- DaveA