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.

作者 martin.panter
收信人 Emil Stenström, ezio.melotti, gvanrossum, martin.panter, vstinner
日期 2016-01-08.03:16:10
SpamBayes Score -1.0
Marked as misclassified
Message-id <1452222970.74.0.537500483634.issue26045@psf.upfronthosting.co.za>
In-reply-to
内容
After reading through the linked thread, there are a few error message proposals:

Guido: "use data.encode('utf-8') if you want the data to be encoded in UTF-8". (Then of course the server might not like it.)

Andrew Barnert: A UnicodeEncodeError (or subclass of it?) with text like "HTTP body without encoding defaults to 'latin-1', which can't encode character '\u5555' in position 30: ordinal not in range(256)")

Paul Moore: Encode as ASCII and catch UnicodeEncodeError and re-raise as a TypeError "Unicode string supplied without an explicit encoding".

Emil, do you think any of these would help?
历史
日期 用户 动作 参数
2016-01-08 03:16:10martin.panter修改recipients: + martin.panter, gvanrossum, vstinner, ezio.melotti, Emil Stenström
2016-01-08 03:16:10martin.panter修改messageid: <1452222970.74.0.537500483634.issue26045@psf.upfronthosting.co.za>
2016-01-08 03:16:10martin.panter链接issue26045 messages
2016-01-08 03:16:10martin.panter创建