7 Jan
2016
7 Jan
'16
12:29 p.m.
On Thu, Jan 7, 2016 at 11:09 PM, Paul Moore
On 7 January 2016 at 11:53, Chris Angelico
wrote: 3) Encode as ASCII, and let any errors bubble up.
4) Encode as ASCII and catch UnicodeEncodeError and re-raise as a TypeError "Unicode string supplied without an explicit encoding".
IMO, the underlying encoding errors are very user-unfriendly, and should nearly always be caught internally and replaced with something more user friendly. Most of the user confusion I see from Unicode issues could probably be significantly alleviated if the user was presented with something better than a raw (en/de)coding error and traceback.
Maybe. Same difference, though - permit ASCII-only, anything else is an error. ChrisA