classification
Title: distutils upload command crashes when displaying server response
Type: behavior Stage: resolved
Components: Distutils, Distutils2 Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: eric.araujo, jcea, pje, tarek
Priority: normal Keywords:

Created on 2010-07-08 13:38 by pje, last changed 2010-11-21 04:14 by eric.araujo. This issue is now closed.

Messages (9)
msg109541 - (view) Author: PJ Eby (pje) * (Python committer) Date: 2010-07-08 13:38
When showing a server response (--show-response), the upload command crashes with the following traceback:

Traceback (most recent call last):
  File "setup.py", line 94, in <module>
    scripts = scripts,
  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/upload.py", line 60, in run
    self.upload_file(command, pyversion, filename)
  File "/usr/lib/python2.7/distutils/command/upload.py", line 189, in upload_file
    self.announce('-'*75, result.read(), '-'*75)
TypeError: announce() takes at most 3 arguments (4 given)

This is apparently due to the change made in r70889, which replaced a "print" statement with a call to self.announce(), but did not change the parameters appropriately.  (The announce() method takes a string and a log level, not an arbitrary number of string arguments.)

I don't know what versions of Python this is in besides 2.7; it may exist in a 2.6.x release or 3.x as well, but it is definitely in the 2.7 release.
msg114418 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-20 02:38
Confirmed in 3.1, 3.2 and distutils2. I’ll fix it shortly.
msg115829 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-09-08 00:19
Fixed in py3k, 3.1, 2.7 (r84611 through r84616) and distutils2 (ea174f2c7d8e). Thanks for the report.
msg120810 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-08 22:01
Reopening because of #10367.
msg120823 - (view) Author: Jesús Cea Avión (jcea) * (Python committer) Date: 2010-11-09 00:07
Éric, I see this in Python 2.7, standard release.

Your fix in SVN seems OK, but I am not sure that using "\n" be very platform agnostic.
msg120825 - (view) Author: Jesús Cea Avión (jcea) * (Python committer) Date: 2010-11-09 00:11
This fix doesn't solve issue10367.
msg120894 - (view) Author: PJ Eby (pje) * (Python committer) Date: 2010-11-09 19:37
Confirmed - issue10367 is not a dupe.  This bug was that a *successful* upload would crash; issue10367 occurs only in the HTTPError case, and isn't fixed by this issue's patch.  Reclosing this and reopening 10367.
msg121715 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-20 18:47
Thanks for correcting me!
msg121861 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-21 04:14
Jesús: There are a lot of literal \n in the current code, so I will assume that they work for now and change them only if there is a bug report.  Thanks for noticing nonetheless.
History
Date User Action Args
2010-11-21 04:14:01eric.araujosetmessages: + msg121861
2010-11-21 01:23:39eric.araujounlinkissue10367 superseder
2010-11-20 18:47:56eric.araujosetresolution: fixed
messages: + msg121715
2010-11-09 19:37:11pjesetstatus: open -> closed

messages: + msg120894
stage: commit review -> resolved
2010-11-09 00:11:44jceasetmessages: + msg120825
2010-11-09 00:07:24jceasetmessages: + msg120823
2010-11-08 22:01:21eric.araujosetstatus: closed -> open

nosy: + jcea
messages: + msg120810

resolution: fixed -> (no value)
stage: resolved -> commit review
2010-11-08 22:00:26eric.araujolinkissue10367 superseder
2010-09-08 00:19:06eric.araujosetstatus: open -> closed
resolution: fixed
messages: + msg115829

stage: resolved
2010-08-20 02:38:13eric.araujosetassignee: tarek -> eric.araujo
type: behavior

components: + Distutils2
title: distutil upload command crashes when displaying server response -> distutils upload command crashes when displaying server response
nosy: + eric.araujo
versions: + Python 3.1, Python 3.2
messages: + msg114418
2010-07-08 13:38:52pjecreate