Issue 1004696: translate Windows newlines when installing scripts on POSIX (original) (raw)

Created on 2004-08-06 16:00 by timcera, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg54228 - (view) Author: Tim Cera (timcera) Date: 2004-08-06 16:00
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
msg54229 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2004-08-11 04:47
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.
msg54230 - (view) Author: Tim Cera (timcera) Date: 2004-08-11 13:12
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.
msg102898 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-04-11 21:59
I’m shocked to learn this bug is still valid. Reassigning to Distutils2, as Distutils is frozen. This bug is a particular case of #870479 Regards
msg112249 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-01 01:25
Marking as superseded.
msg138934 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-24 12:20
FTR, We’re going to follow setuptools’ lead and generate platform-appropriate script or binary files from callables.
History
Date User Action Args
2022-04-11 14:56:06 admin set github: 40702
2011-06-24 12:20:38 eric.araujo set superseder: Scripts need platform-dependent handling -> packaging: generate scripts from callable (dotted paths)messages: +
2010-08-01 01:27:06 eric.araujo set superseder: translate Windows newlines when installing scripts on POSIX -> Scripts need platform-dependent handling
2010-08-01 01:27:06 eric.araujo unlink issue1004696 superseder
2010-08-01 01:25:18 eric.araujo set status: open -> closedsuperseder: translate Windows newlines when installing scripts on POSIXcomponents: + Distutils, - Distutils2versions: + Python 3.2, - Python 3.1, Python 2.7nosy:kbk, timcera, tarek, eric.araujomessages: + resolution: duplicatestage: resolved
2010-08-01 01:25:18 eric.araujo link issue1004696 superseder
2010-04-11 21:59:37 eric.araujo set 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
2010-04-09 00:00:14 eric.araujo set nosy: + eric.araujo
2009-02-08 19:36:53 tarek set assignee: tarekversions: + Python 3.1, Python 2.7
2009-02-08 19:21:27 akitada set nosy: + tarek
2007-10-28 19:33:21 kbk set assignee: kbk -> (no value)
2004-08-06 16:00:18 timcera create