This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: TypeError when running setup.py upload --show-response
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: berker.peksag, eric.araujo, jaraco, labrat, mitya57, tarek
Priority: normal Keywords: patch

Created on 2013-03-05 09:56 by mitya57, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
distutils-decode-server-response.patch mitya57, 2013-03-05 09:56
Messages (5)
msg183517 - (view) Author: Dmitry Shachnev (mitya57) * Date: 2013-03-05 09:56
When running `python3 setup.py sdist upload --show-response`, one may get this exception:

Traceback (most recent call last):
  File "setup.py", line 47, in <module>
    requires=['dbus']
  File "/usr/lib/python3.2/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.2/distutils/dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.2/distutils/command/upload.py", line 66, in run
    self.upload_file(command, pyversion, filename)
  File "/usr/lib/python3.2/distutils/command/upload.py", line 201, in upload_file
    msg = '\n'.join(('-' * 75, r.read(), '-' * 75))
TypeError: sequence item 1: expected str instance, bytes found

This happens because r is binary stream, so r.read() returns bytes. A trivial patch that fixes the problem is attached.
msg183981 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2013-03-11 17:29
Thanks for the report and patch.  I think this bug is already reported, I’ll search for the duplicate when I get time.
msg191107 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2013-06-14 08:40
Duplicate of issue 12853.
msg202928 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2013-11-15 09:47
Oh, I was wrong. This is not a duplicate of issue 12853 (but they are related).

Also, the patch in issue 19226 is looks better to me.
msg203001 - (view) Author: Jason R. Coombs (jaraco) * (Python committer) Date: 2013-11-16 01:16
Berker reports in issue12853, msg202927 that the issue is fixed for Python 3.3 and 3.4 by the patch for issue6286 applied as part of issue19544.
History
Date User Action Args
2022-04-11 14:57:42adminsetgithub: 61556
2013-11-16 01:16:16jaracosetstatus: open -> closed
resolution: fixed
messages: + msg203001

stage: patch review -> resolved
2013-11-15 09:47:58berker.peksagsetstatus: closed -> open

superseder: global name 'r' is not defined in upload.py ->
versions: + Python 3.4, - Python 3.2
nosy: + jaraco, labrat

messages: + msg202928
resolution: duplicate -> (no value)
stage: resolved -> patch review
2013-06-14 08:40:42berker.peksagsetstatus: open -> closed

superseder: global name 'r' is not defined in upload.py
nosy: + berker.peksag

messages: + msg191107
type: behavior
resolution: duplicate
stage: resolved
2013-03-11 17:30:18eric.araujosetassignee: eric.araujo

nosy: + tarek
components: + Distutils, - Library (Lib)
versions: + Python 3.2
2013-03-11 17:29:47eric.araujosetnosy: + eric.araujo
messages: + msg183981
2013-03-05 09:56:30mitya57create