[New-bugs-announce] [issue12853] global name 'r' is not defined in upload.py

Russell Owen report at bugs.python.org
Mon Aug 29 19:08:20 CEST 2011

New submission from Russell Owen <reowen at users.sourceforge.net>:

When using distutils to upload code to PyPI I get the following message (but the upload is successful):
Traceback (most recent call last):
  File "setup.py", line 60, in <module>
    zip_safe = False, # icons (e.g. as used by RO.Wdg.GrayImageDispWdg) are not retrieved in a zip-safe way
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/upload.py", line 60, in run
    self.upload_file(command, pyversion, filename)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/upload.py", line 180, in upload_file
    msg = '\n'.join(('-' * 75, r.read(), '-' * 75))
NameError: global name 'r' is not defined
A look at the current source code shows that there is indeed no variable "r". I'm not sure what was intended but it seems likely that it would be possible to replace r.read() by reason, status, or a combination of the two.

messages: 143162
nosy: reowen
priority: normal
severity: normal
status: open
title: global name 'r' is not defined in upload.py
type: behavior
versions: Python 2.7, Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list