[Python-Dev] Re: Relaxing Unicode error handling (original) (raw)

Jack Jansen Jack.Jansen at cwi.nl
Sat Jan 3 16:39:03 EST 2004


On 3-jan-04, at 21:06, Martin v. Loewis wrote:

Aahz wrote:

Library writers should avoid using it. If the application uses it, libraries should not notice, since they won't get exceptions that they should not have gotten in the first place. What if a library wants to ensure that it does get appropriate exceptions so that it can handle them? It would explicitly need to encode/decode strings as us-ascii, instead of relying on the default encoding (which it shouldn't do in the first place).

Do I understand correctly then that this relaxed error handling could be seen as an "argument" to the encoding, i.e. it turns "us-ascii" into "us-ascii-relaxed"?

Because if that is so, then isn't the best way to implement this to not bother with sys.relaxedunicodeerrors, but in stead use a special encoding name (or a parameter to an encoding name, such as "us-ascii;relaxed")?

Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman



More information about the Python-Dev mailing list