python 2.0 won't run scripts with \r\n line termination on RH7?

Cesar Rabak csrabak at uol.com.br
Sun Feb 11 21:47:52 EST 2001


Clarence Gardner wrote:
> 
> >"Mike Carifio" <carifio.nospam at nospam.usys.com> wrote in message
> >news:t8c7a69cqerq7c at corp.supernews.com...
> >> I have a network of Linux and Windows machines. On a Windows box, I have
> >> several python scripts which I'd also like to run on the Linux machines.
> >> I've
> >> smbmounted the Windows share to see the scripts, but having been created
> >> on the Windows box, the line termination in those files is \r\n. When I
> >try
> >> to execute the script, say 'start', I get:
> >>
> >> bash: ./start.py: No such file or directory
> >>
> >> When I "clean up" start.py with tr - tr -d '\r' < start.py >
> >reallystart.py,
> >> it
> >> runs. So it seems like python 2 can't compensate for wierd Windows line
> >> terminators. Any workarounds, other than 'tr'? Pl. advise. Tx.

I'm not a samba guru, but get a look (perhaps with a local expert) if
samba has the same functionality that mtools have to automagically
convert DOS (CRLF) to Unix (LF) text files. May be the final touch
you're looking for...

HTH

Cesar



More information about the Python-list mailing list