[ python-Feature Requests-1004696 ] translate Windows cr-lf when installing scripts on Linux

SourceForge.net noreply at sourceforge.net
Wed Aug 11 15:12:37 CEST 2004


Feature Requests item #1004696, was opened at 2004-08-06 12:00
Message generated for change (Comment added) made by timcera
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1004696&group_id=5470

>Category: Distutils
Group: None
>Status: Open
>Resolution: None
>Priority: 2
Submitted By: Tim Cera (timcera)
Assigned to: Kurt B. Kaiser (kbk)
Summary: translate Windows cr-lf when installing scripts on Linux

Initial Comment:
PROBLEM 
If a file installed as a script has Window cr-lf 
endings, even if the '#!/usr/bin/env python' is 
included to support direct execution on Linux, it 
doesn't work because the shell is confused by the 
cr-lf. 
 
This problem has been addressed in the newsgroups, 
with the usual solution to manually change the line 
endings, or only develop with an editor that can 
maintain Linux line endings. 
 
SOLUTION 
Convert line endings on installed scripts to the line 
endings appropriate to the machine running the 
installation.  Could be limited to Unix/Linux 
platform because Windows doesn't care about the line 
endings. 
 
kindest regards, 
tim 

----------------------------------------------------------------------

>Comment By: Tim Cera (timcera)
Date: 2004-08-11 09:12

Message:
Logged In: YES 
user_id=169213

I put this back in distutils category instead of Python core.  I read over 
what I had written (and the response from kbk) and it is obvious that I 
wasn't clear. 
 
A Windows developer that uses distutils would be frustrated by their 
scripts not working on Unix/Linux because of the cr-lf endings, even if 
they had included the Unix/Linux '#!/usr/bin/env python' as the first 
line. 
 
I am asking that when _distutils_ installs an executable script that the 
line endings in each executable script are set to those appropriate for 
the target machine. 
 
In this way a Windows programer can ignore the line-ending formats of 
their scripts and distutils will quietly take care of the problem. 
 
sorry for the confusion and I hope that I have explained my idea 
better. 

----------------------------------------------------------------------

Comment By: Kurt B. Kaiser (kbk)
Date: 2004-08-11 00:47

Message:
Logged In: YES 
user_id=149084

"Universal New Lines"
See PEP 278, implemented at Python 2.3.
It is better not to automagically modify the script
when running it.  However, there is a script
'crlf.py' in Tools/scripts which will convert
files with Windows line endings to Unix
line endings, if you wish to do that.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1004696&group_id=5470


More information about the Python-bugs-list mailing list