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.

Title: TypeError when running upload --show-response
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.3, Python 3.4
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.

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 sdist upload --show-response`, one may get this exception:

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

This happens because r is binary stream, so 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.
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 ->
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
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