[New-bugs-announce] [issue17354] TypeError when running setup.py upload --show-response
Dmitry Shachnev
report at bugs.python.org
Tue Mar 5 10:56:30 CET 2013
New submission from Dmitry Shachnev:
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.
----------
components: Library (Lib)
files: distutils-decode-server-response.patch
keywords: patch
messages: 183517
nosy: mitya57
priority: normal
severity: normal
status: open
title: TypeError when running setup.py upload --show-response
versions: Python 3.3
Added file: http://bugs.python.org/file29312/distutils-decode-server-response.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17354>
_______________________________________
More information about the New-bugs-announce
mailing list