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

bdist_wininst no longer works on non-Windows platforms #49981

Closed
pfmoore opened this issue Apr 9, 2009 · 5 comments
Closed

bdist_wininst no longer works on non-Windows platforms #49981

pfmoore opened this issue Apr 9, 2009 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@pfmoore
Copy link
Member

pfmoore commented Apr 9, 2009

BPO 5731
Nosy @mhammond, @pfmoore, @tarekziade, @merwok
Files
  • bdist_wininst.patch
  • 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 2009-04-09.22:52:15.749>
    created_at = <Date 2009-04-09.20:51:23.057>
    labels = ['type-bug', 'library']
    title = 'bdist_wininst no longer works on non-Windows platforms'
    updated_at = <Date 2010-10-18.20:44:51.421>
    user = 'https://github.com/pfmoore'

    bugs.python.org fields:

    activity = <Date 2010-10-18.20:44:51.421>
    actor = 'eric.araujo'
    assignee = 'tarek'
    closed = True
    closed_date = <Date 2009-04-09.22:52:15.749>
    closer = 'tarek'
    components = ['Distutils']
    creation = <Date 2009-04-09.20:51:23.057>
    creator = 'paul.moore'
    dependencies = []
    files = ['13666']
    hgrepos = []
    issue_num = 5731
    keywords = ['patch']
    message_count = 5.0
    messages = ['85825', '85829', '85830', '85833', '119078']
    nosy_count = 4.0
    nosy_names = ['mhammond', 'paul.moore', 'tarek', 'eric.araujo']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue5731'
    versions = ['Python 2.6', 'Python 3.0', 'Python 3.1', 'Python 2.7']

    @pfmoore
    Copy link
    Member Author

    pfmoore commented Apr 9, 2009

    In revision 62197, Mon Apr 7 01:53:39 2008 UTC, Mark Hammond added code
    to Lib/distutils/command/bdist_wininst.py which was intended to select
    an architecture-specific installer executable.

    In doing so, the code appears to have broken the ability to build
    installers on non-Windows platforms.

    The current code is

    if self.plat_name == 'win32':
        sfix = ''
    else:
        sfix = self.plat_name[3:] # strip 'win' - leaves eg '-amd64'
    filename = os.path.join(directory, "wininst-%.1f%s.exe" % (bv, sfix))
    return open(filename, "rb").read()

    This says "strip 'win'", but in practice strips the first 3 characters
    from any plat_name other than win32.

    I've attached an untested patch to fix this, by setting sfix to '' if
    self.plat_name doesn't start with 'win'.

    @pfmoore pfmoore added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Apr 9, 2009
    @mhammond
    Copy link
    Contributor

    mhammond commented Apr 9, 2009

    +1 on the idea - it's not the first time I've forgotten that works on
    platforms other than Windows. It appears the patch you attached is
    reversed though (or its just way too early for me...)

    @tarekziade
    Copy link
    Mannequin

    tarekziade mannequin commented Apr 9, 2009

    Mark, I have just applied the patch in r71413 because it was obvious.

    If it's fine with you I'll backport it to 2.6 so it makes it to 2.6.2 final

    @tarekziade
    Copy link
    Mannequin

    tarekziade mannequin commented Apr 9, 2009

    fixed in r71413 and r71415.

    Thanks for the patch !

    @tarekziade tarekziade mannequin closed this as completed Apr 9, 2009
    @merwok
    Copy link
    Member

    merwok commented Oct 18, 2010

    Follow-up in bpo-8954

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 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-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants