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.

Author labrat
Recipients eric.araujo, labrat, tarek
Date 2013-10-11.16:31:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1381509075.7.0.951655438313.issue19226@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2013-10-11 16:31:15labratsetrecipients: + labrat, tarek, eric.araujo
2013-10-11 16:31:15labratsetmessageid: <1381509075.7.0.951655438313.issue19226@psf.upfronthosting.co.za>
2013-10-11 16:31:15labratlinkissue19226 messages
2013-10-11 16:31:15labratcreate