[Python-Dev] Re: Relaxing Unicode error handling
Martin v. Loewis
martin at v.loewis.de
Sat Jan 3 15:06:30 EST 2004
>>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).
> Right, but if different parts of an application are turning this off and
> on, you'll get invalid results, such as unexpected exceptions. The
> question isn't whether Python's internal state will be consistent, but
> whether applications can ensure a consistent state for themselves.
When you turn this on, you will get invalid results, period. This
is precisely what people request.
More information about the Python-Dev