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.

作者 Emil Stenström
收信人 Emil Stenström, ezio.melotti, gvanrossum, martin.panter, vstinner
日期 2016-01-08.16:04:12
SpamBayes Score -1.0
Marked as misclassified
Message-id <1452269053.12.0.536534452904.issue26045@psf.upfronthosting.co.za>
In-reply-to
内容
I think changing the error message is enough for the short term, and deprecation of automatic encoding is the correct way in the long term.

A text that mention "utf-8" which will likely be the correct solution definitely gets my vote, so Guidos suggestion sounds good to me:

UnicodeEncodeError("Use data.encode('utf-8') if you want the data to be encoded in UTF-8")

Andrew's and Pauls suggestions doesn't point to a solution to the problem, which I think is a great think for something this basic. Also, the error message only gets shown when latin-1 fails, so we can't use text that speaks about "no encoding" in general.
历史
日期 用户 动作 参数
2016-01-08 16:04:13Emil Stenström修改recipients: + Emil Stenström, gvanrossum, vstinner, ezio.melotti, martin.panter
2016-01-08 16:04:13Emil Stenström修改messageid: <1452269053.12.0.536534452904.issue26045@psf.upfronthosting.co.za>
2016-01-08 16:04:13Emil Stenström链接issue26045 messages
2016-01-08 16:04:12Emil Stenström创建