Wrong print format in http method

Bug #380940 reported by David Erosa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dput (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: dput

When trying to upload a package using a not allowed method (http in my case), dput crashes with the following message:

#
Uploading to lp (via http to ppa.launchpad.net):
  Uploading tkgate_1.8.7-2~ppa1.dsc: Traceback (most recent call last):
  File "/usr/bin/dput", line 938, in <module>
    main()
  File "/usr/bin/dput", line 900, in main
    files_to_upload, debug, 0, progress=progress)
  File "/usr/share/dput/http.py", line 123, in upload
    print "Upload failed: %d %d"% (res.status, res.reason)
TypeError: %d format: a number is required, not str
#

Changing the line to:
print "Upload failed:", res.status, res.reason

Shows the following:
Uploading tkgate_1.8.7-2~ppa1.dsc: Upload failed: 405 Method Not Allowed

Revision history for this message
David Erosa (erosa) wrote :

I think I fixed it on my branch:
    lp:~erosa/+junk/dput-fix-380940

I've also attached a patch for the current jaunty branch.

Revision history for this message
David Erosa (erosa) wrote :
Revision history for this message
David Erosa (erosa) wrote :

Attached the patch with the correct debdiff format.

Revision history for this message
Evan (ev) wrote :

Do we actually need to single out this error? David, does this patch work for you?

Revision history for this message
David Erosa (erosa) wrote :

Not really a need. I just did the differenciation in my patch because of the previous check for the "unauthorized" error code.

The patch works ok for me. It is the same change I tried first in my system and later wrote on the bug report.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dput - 0.9.4ubuntu2

---------------
dput (0.9.4ubuntu2) karmic; urgency=low

  * Don't incorrectly assume that HTTPResonse.reason is an integer when
    generating an error message (LP: #380940).

 -- Evan Dandrea <email address hidden> Fri, 19 Jun 2009 10:15:53 +0100

Changed in dput (Ubuntu):
status: New → Fix Released
Revision history for this message
Evan (ev) wrote :

Thanks for confirming and the initial attempt at a fix for this. I've uploaded the change to Karmic.

Changed in dput (Ubuntu):
status: Fix Released → Fix Committed
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.