消息 [257763]
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:13 | Emil Stenström | 修改 | recipients:
+ Emil Stenström, gvanrossum, vstinner, ezio.melotti, martin.panter |
| 2016-01-08 16:04:13 | Emil Stenström | 修改 | messageid: <1452269053.12.0.536534452904.issue26045@psf.upfronthosting.co.za> |
| 2016-01-08 16:04:13 | Emil Stenström | 链接 | issue26045 messages |
| 2016-01-08 16:04:12 | Emil Stenström | 创建 | |
|