Message199489
Avoid:
Traceback (most recent call last):
File "setup.py", line 61, in <module>
'html2text (>=3.0.1)',
File "/.../python3.2/distutils/core.py", line 148, in setup
dist.run_commands()
File "/.../python3.2/distutils/dist.py", line 917, in run_commands
self.run_command(cmd)
File "/.../python3.2/distutils/dist.py", line 936, in run_command
cmd_obj.run()
File "/.../python3.2/distutils/command/upload.py", line 66, in run
self.upload_file(command, pyversion, filename)
File "/.../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
by converting the bytes returned by HTTPResponse.read [1] to a string
before joinging it with other strings. HTTPResponse.headers supports
the Message interface [2], so we can use get_param to extract the
charset [3], falling back on ISO-8859-1 [4].
[1]: http://docs.python.org/3/library/http.client.html#http.client.HTTPResponse.read
[2]: http://docs.python.org/3/library/http.client.html#httpmessage-objects
[3]: http://docs.python.org/3/library/email.message.html#email.message.Message.get_param
[4]: http://tools.ietf.org/html/rfc2616#section-3.7.1 |
|
Date |
User |
Action |
Args |
2013-10-11 16:31:15 | labrat | set | recipients:
+ labrat, tarek, eric.araujo |
2013-10-11 16:31:15 | labrat | set | messageid: <1381509075.7.0.951655438313.issue19226@psf.upfronthosting.co.za> |
2013-10-11 16:31:15 | labrat | link | issue19226 messages |
2013-10-11 16:31:15 | labrat | create | |
|