[issue4338] TypeError (bytes/str) in distutils command "upload"

Amaury Forgeot d'Arc report at bugs.python.org
Wed Nov 19 13:00:22 CET 2008


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

To correct the reported problem, 3 lines are indeed enough.

I just wanted to test my changes, so I ran "setup.py bdist upload" on my
favourite package, even if I expect it to fail at the end because I
don't have a valid PyPI account.

Here are the problems I encountered:
- io.StringIO is used but "import io" is missing
- http = http.client.HTTPConnection() fails because the local variable
has the same name as the imported module
- the http body must be a bytes string

I agree that the change around http.request() is not needed.
Here is another patch with less changes.
It is also more correct that the previous one, now I receive a http 401
error which means that the request was at least understood by the server.

Added file: http://bugs.python.org/file12056/distutils_upload_2.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4338>
_______________________________________


More information about the Python-bugs-list mailing list