[Python-ideas] Py3k invalid unicode idea

Stephen J. Turnbull stephen at xemacs.org
Fri Oct 10 04:25:22 CEST 2008


Dillon Collins writes:

 > It just seems like a more elegant solution to me.

Like most problems rooted in POSIX (more fairly, in implementation
dependencies), it's not a problem amenable to elegant solutions.  The
data is conceptually a human-readable string, and therefore should be
representable in Unicode.  In practice, it normally is, but there are
no guarantees.

IMO, in this kind of situation it is best to raise the exception as
early as possible to preserve the context in which it occurred.

I have no objection to providing a library of handlers to implement
the strategies you propose, just to making any of them a Python core
default.




More information about the Python-ideas mailing list