Message257763
| Author |
Emil Stenström |
| Recipients |
Emil Stenström, ezio.melotti, gvanrossum, martin.panter, vstinner |
| Date |
2016年01月08日.16:04:12 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1452269053.12.0.536534452904.issue26045@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|