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 upload command crashes when displaying server response #53445

Closed
pjeby mannequin opened this issue Jul 8, 2010 · 9 comments
Closed

distutils upload command crashes when displaying server response #53445

pjeby mannequin opened this issue Jul 8, 2010 · 9 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@pjeby
Copy link
Mannequin

pjeby mannequin commented Jul 8, 2010

BPO 9199
Nosy @jcea, @pjeby, @tarekziade, @merwok

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/merwok'
closed_at = <Date 2010-11-09.19:37:11.640>
created_at = <Date 2010-07-08.13:38:52.796>
labels = ['type-bug', 'library']
title = 'distutils upload command crashes when displaying server response'
updated_at = <Date 2010-11-21.04:14:01.419>
user = 'https://github.com/pjeby'

bugs.python.org fields:

activity = <Date 2010-11-21.04:14:01.419>
actor = 'eric.araujo'
assignee = 'eric.araujo'
closed = True
closed_date = <Date 2010-11-09.19:37:11.640>
closer = 'pje'
components = ['Distutils', 'Distutils2']
creation = <Date 2010-07-08.13:38:52.796>
creator = 'pje'
dependencies = []
files = []
hgrepos = []
issue_num = 9199
keywords = []
message_count = 9.0
messages = ['109541', '114418', '115829', '120810', '120823', '120825', '120894', '121715', '121861']
nosy_count = 4.0
nosy_names = ['jcea', 'pje', 'tarek', 'eric.araujo']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue9199'
versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

@pjeby
Copy link
Mannequin Author

pjeby mannequin commented Jul 8, 2010

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.

@pjeby pjeby mannequin assigned tarekziade Jul 8, 2010
@pjeby pjeby mannequin added the stdlib Python modules in the Lib dir label Jul 8, 2010
@merwok
Copy link
Member

merwok commented Aug 20, 2010

Confirmed in 3.1, 3.2 and distutils2. I’ll fix it shortly.

@merwok merwok changed the title distutil upload command crashes when displaying server response distutils upload command crashes when displaying server response Aug 20, 2010
@merwok merwok assigned merwok and unassigned tarekziade Aug 20, 2010
@merwok merwok added the type-bug An unexpected behavior, bug, or error label Aug 20, 2010
@merwok
Copy link
Member

merwok commented Sep 8, 2010

Fixed in py3k, 3.1, 2.7 (r84611 through r84616) and distutils2 (ea174f2c7d8e). Thanks for the report.

@merwok merwok closed this as completed Sep 8, 2010
@merwok
Copy link
Member

merwok commented Nov 8, 2010

Reopening because of bpo-10367.

@merwok merwok reopened this Nov 8, 2010
@jcea
Copy link
Member

jcea commented Nov 9, 2010

É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.

@jcea
Copy link
Member

jcea commented Nov 9, 2010

This fix doesn't solve bpo-10367.

@pjeby
Copy link
Mannequin Author

pjeby mannequin commented Nov 9, 2010

Confirmed - bpo-10367 is not a dupe. This bug was that a *successful* upload would crash; bpo-10367 occurs only in the HTTPError case, and isn't fixed by this issue's patch. Reclosing this and reopening 10367.

@pjeby pjeby mannequin closed this as completed Nov 9, 2010
@merwok
Copy link
Member

merwok commented Nov 20, 2010

Thanks for correcting me!

@merwok
Copy link
Member

merwok commented Nov 21, 2010

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.

@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

2 participants