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

distutils command 'upload' crashes when --show-response is selected #56179

Closed
offby1 mannequin opened this issue May 1, 2011 · 5 comments
Closed

distutils command 'upload' crashes when --show-response is selected #56179

offby1 mannequin opened this issue May 1, 2011 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@offby1
Copy link
Mannequin

offby1 mannequin commented May 1, 2011

BPO 11970
Nosy @tarekziade, @merwok
Superseder
  • bpo-10367: "python setup.py sdist upload --show-response" can fail with "UnboundLocalError: local variable 'result' referenced before assignment"
  • Files
  • upload-failed.log
  • 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 2011-05-03.21:17:09.444>
    created_at = <Date 2011-05-01.13:42:20.484>
    labels = ['library', 'type-crash']
    title = "distutils command 'upload' crashes when --show-response is selected"
    updated_at = <Date 2011-05-04.16:14:41.213>
    user = 'https://bugs.python.org/offby1'

    bugs.python.org fields:

    activity = <Date 2011-05-04.16:14:41.213>
    actor = 'eric.araujo'
    assignee = 'tarek'
    closed = True
    closed_date = <Date 2011-05-03.21:17:09.444>
    closer = 'offby1'
    components = ['Distutils']
    creation = <Date 2011-05-01.13:42:20.484>
    creator = 'offby1'
    dependencies = []
    files = ['21845']
    hgrepos = []
    issue_num = 11970
    keywords = []
    message_count = 5.0
    messages = ['134908', '135071', '135138', '135139', '135140']
    nosy_count = 3.0
    nosy_names = ['tarek', 'eric.araujo', 'offby1']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '10367'
    type = 'crash'
    url = 'https://bugs.python.org/issue11970'
    versions = ['Python 2.7']

    @offby1
    Copy link
    Mannequin Author

    offby1 mannequin commented May 1, 2011

    When running distutils like so:

    .tox/py27/bin/python setup.py -v bdist_egg upload --show-response

    Eventually, after everything else spools by, this pops up:

    Using PyPI login from /Users/offline/.pypirc
    Submitting dist/PyHamcrest-1.5-py2.7.egg to http://pypi.python.org/pypi
    Upload failed (401): You must be identified to edit package information
    Traceback (most recent call last):
      File "setup.py", line 69, in <module>
        setup(**all_params)
      File "/usr/local/Cellar/python/2.7.1/lib/python2.7/distutils/core.py", line 152, in setup
        dist.run_commands()
      File "/usr/local/Cellar/python/2.7.1/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/local/Cellar/python/2.7.1/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/local/Cellar/python/2.7.1/lib/python2.7/distutils/command/upload.py", line 60, in run
        self.upload_file(command, pyversion, filename)
      File "/usr/local/Cellar/python/2.7.1/lib/python2.7/distutils/command/upload.py", line 193, in upload_file
        msg = '\n'.join(('-' * 75, r.read(), '-' * 75))
    NameError: global name 'r' is not defined

    @offby1 offby1 mannequin assigned tarekziade May 1, 2011
    @offby1 offby1 mannequin added stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump labels May 1, 2011
    @offby1
    Copy link
    Mannequin Author

    offby1 mannequin commented May 3, 2011

    I can see that this is only an error in the 2.7.1 release, and is fixed in distutils on the 2.7 branch (along with other bugs, too, from what I can see.)

    I'm closing it as invalid, given that.

    @offby1 offby1 mannequin added the invalid label May 3, 2011
    @offby1 offby1 mannequin closed this as completed May 3, 2011
    @merwok
    Copy link
    Member

    merwok commented May 4, 2011

    Are you sure? This looks like bpo-10367 (unsolved yet), not bpo-9199 (fixed).

    @offby1
    Copy link
    Mannequin Author

    offby1 mannequin commented May 4, 2011

    No, not 100% sure, but my read of the 2.7 branch code certainly seemed to suggest that it was fixed.

    in distutil/commands/upload.py:

    Line 193 gets the response unconditionally as 'r' from the http object

    Line 201 uses 'r' to show the response.

    I might be missing a form that the 'r' object can take that isn't going to have a read() method, but I doubt it.

    @offby1
    Copy link
    Mannequin Author

    offby1 mannequin commented May 4, 2011

    ... oh, except I'm an idiot, and I think I'm reading tip code there.

    Yep, I'm an idiot.

    Okay, but this is still a dupe of bpo-10367

    @offby1 offby1 mannequin removed the invalid label May 4, 2011
    @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-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant