Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translate Windows newlines when installing scripts on POSIX #40702

Closed
timcera mannequin opened this issue Aug 6, 2004 · 6 comments
Closed

translate Windows newlines when installing scripts on POSIX #40702

timcera mannequin opened this issue Aug 6, 2004 · 6 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@timcera
Copy link
Mannequin

timcera mannequin commented Aug 6, 2004

BPO 1004696
Nosy @kbkaiser, @tarekziade, @merwok
Superseder
  • bpo-12394: packaging: generate scripts from callable (dotted paths)
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/tarekziade'
    closed_at = <Date 2010-08-01.01:25:18.820>
    created_at = <Date 2004-08-06.16:00:18.000>
    labels = ['type-feature', 'library']
    title = 'translate Windows newlines when installing scripts on POSIX'
    updated_at = <Date 2011-06-24.12:20:38.723>
    user = 'https://bugs.python.org/timcera'

    bugs.python.org fields:

    activity = <Date 2011-06-24.12:20:38.723>
    actor = 'eric.araujo'
    assignee = 'tarek'
    closed = True
    closed_date = <Date 2010-08-01.01:25:18.820>
    closer = 'eric.araujo'
    components = ['Distutils']
    creation = <Date 2004-08-06.16:00:18.000>
    creator = 'timcera'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 1004696
    keywords = []
    message_count = 6.0
    messages = ['54228', '54229', '54230', '102898', '112249', '138934']
    nosy_count = 4.0
    nosy_names = ['kbk', 'timcera', 'tarek', 'eric.araujo']
    pr_nums = []
    priority = 'low'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '12394'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue1004696'
    versions = ['Python 3.2']

    @timcera
    Copy link
    Mannequin Author

    timcera mannequin commented Aug 6, 2004

    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

    @timcera timcera mannequin assigned kbkaiser Aug 6, 2004
    @timcera timcera mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Aug 6, 2004
    @timcera timcera mannequin assigned kbkaiser Aug 6, 2004
    @timcera timcera mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Aug 6, 2004
    @kbkaiser
    Copy link
    Contributor

    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.

    @timcera
    Copy link
    Mannequin Author

    timcera mannequin commented Aug 11, 2004

    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.

    @merwok
    Copy link
    Member

    merwok commented Apr 11, 2010

    I’m shocked to learn this bug is still valid.

    Reassigning to Distutils2, as Distutils is frozen. This bug is a particular case of bpo-870479

    Regards

    @merwok merwok removed the stdlib Python modules in the Lib dir label Apr 11, 2010
    @merwok merwok changed the title translate Windows cr-lf when installing scripts on Linux translate Windows newlines when installing scripts on POSIX Apr 11, 2010
    @merwok merwok removed the stdlib Python modules in the Lib dir label Apr 11, 2010
    @merwok merwok changed the title translate Windows cr-lf when installing scripts on Linux translate Windows newlines when installing scripts on POSIX Apr 11, 2010
    @merwok
    Copy link
    Member

    merwok commented Aug 1, 2010

    Marking as superseded.

    @merwok merwok added the stdlib Python modules in the Lib dir label Aug 1, 2010
    @merwok merwok closed this as completed Aug 1, 2010
    @merwok merwok added the stdlib Python modules in the Lib dir label Aug 1, 2010
    @merwok merwok closed this as completed Aug 1, 2010
    @merwok
    Copy link
    Member

    merwok commented Jun 24, 2011

    FTR, We’re going to follow setuptools’ lead and generate platform-appropriate script or binary files from callables.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants