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
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.
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.
nosy:kbk, timcera, tarek, eric.araujomessages: + components: + Distutils2, - Distutilstitle: translate Windows cr-lf when installing scripts on Linux -> translate Windows newlines when installing scripts on POSIX