Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #39890
| Date | 2013-02-25 08:14 -0500 |
|---|---|
| From | Dave Angel <davea@davea.name> |
| Subject | Re: Shebang line on Windows? |
| References | <kg8cm0$flo$1@news.albasani.net> <CAKJDb-NW2ut0=6n_TD3VC=5pR5rc+kOfHANtjVxKB6EtFwtbNw@mail.gmail.com> <mailman.2294.1361558483.2939.python-list@python.org> <b94bb7c4-14c2-4783-b13d-8a77e8dd6f32@r8g2000vbj.googlegroups.com> <DCD75728F460F14586086EA606E8308282821A1D@ACEVXCHMBX1001.ADVENTISTCORP.NET> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2503.1361798104.2939.python-list@python.org> (permalink) |
> -----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 <zachary.ware+pyl...@gmail.com> > > 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
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Shebang line on Windows? Walter Hurry <walterhurry@lavabit.com> - 2013-02-22 18:16 +0000
Re: Shebang line on Windows? Dave Angel <davea@davea.name> - 2013-02-22 13:40 -0500
Re: Shebang line on Windows? Zachary Ware <zachary.ware+pylist@gmail.com> - 2013-02-22 12:40 -0600
Re: Shebang line on Windows? James Harris <james.harris.1@gmail.com> - 2013-02-22 14:53 -0800
Re: Shebang line on Windows? MRAB <python@mrabarnett.plus.com> - 2013-02-22 23:21 +0000
RE: Shebang line on Windows? "Sells, Fred" <fred.sells@adventistcare.org> - 2013-02-25 12:35 +0000
Re: Shebang line on Windows? Dave Angel <davea@davea.name> - 2013-02-25 08:14 -0500
Re: Shebang line on Windows? Chris Gonnerman <chris@gonnerman.org> - 2013-02-25 07:28 -0600
Re: Shebang line on Windows? Chris Angelico <rosuav@gmail.com> - 2013-02-26 00:54 +1100
Re: Shebang line on Windows? Michael Torrie <torriem@gmail.com> - 2013-02-25 10:18 -0700
Re: Shebang line on Windows? Anssi Saari <as@sci.fi> - 2013-02-26 16:30 +0200
Re: Shebang line on Windows? "D'Arcy J.M. Cain" <darcy@druid.net> - 2013-02-25 12:29 -0500
Re: Shebang line on Windows? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-26 00:52 +0000
Re: Shebang line on Windows? Michael Torrie <torriem@gmail.com> - 2013-02-25 19:08 -0700
Re: Shebang line on Windows? Dave Angel <davea@davea.name> - 2013-02-25 21:23 -0500
Re: Shebang line on Windows? MRAB <python@mrabarnett.plus.com> - 2013-02-26 03:08 +0000
Re: Shebang line on Windows? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-02-25 22:44 -0500
Re: Shebang line on Windows? David Robinow <drobinow@gmail.com> - 2013-02-25 13:19 -0500
Re: Shebang line on Windows? Michael Torrie <torriem@gmail.com> - 2013-02-25 11:29 -0700
Re: Shebang line on Windows? Michael Torrie <torriem@gmail.com> - 2013-02-25 11:33 -0700
csiph-web