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


Groups > comp.lang.python > #39900

Re: Shebang line on Windows?

Date 2013-02-25 12:29 -0500
From "D'Arcy J.M. Cain" <darcy@druid.net>
Subject Re: Shebang line on Windows?
References (2 earlier) <mailman.2294.1361558483.2939.python-list@python.org> <b94bb7c4-14c2-4783-b13d-8a77e8dd6f32@r8g2000vbj.googlegroups.com> <DCD75728F460F14586086EA606E8308282821A1D@ACEVXCHMBX1001.ADVENTISTCORP.NET> <512B63BC.6090600@davea.name> <512B9CF4.3070604@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2512.1361814005.2939.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, 25 Feb 2013 10:18:44 -0700
Michael Torrie <torriem@gmail.com> wrote:
> On 02/25/2013 06:14 AM, Dave Angel wrote:
> > 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.
> 
> Actually, the shell isn't involved in parsing the shebang line at all.
> That's actually done in the kernel by the program loader.  So it's the
> kernel that has a problem with it; wonder if Linus would accept a
> patch to ignore the tailing CR?

So much the wrong solution.  First of all, I don't think that Linus is
on the bash development team so he can't help there.  Also, bash is not
the only shell in the world.  And, Linux is not the only operating
system in the world.  There are still a lot of Unix systems (the system
that Linux is a clone of) out there.  FreeBSD, NetBSD, Solaris, Mac
OSX, etc.  You can't expect all of them to bend over backwards for
every Windows wart out there.

I don't run Windows myself so I can't test it but doesn't Python on
Windows work fine with Unix style EOL?  So why not strip out the CR and
run the same file everywhere?

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.
IM: darcy@Vex.Net, VOIP: sip:darcy@Vex.Net

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


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