[Python-Dev] Relaxing Unicode error handling

Guido van Rossum guido at python.org
Mon Jan 5 11:44:43 EST 2004


>     >> I'd like to add a static property unicode.errorhandling, ...
>     >> What do you think?
> 
>     Guido> This is a global default, right?  Seems to work for the socket
>     Guido> timeout; I think the case for a global default is similar.
> 
> Not so fast, pardner. <wink> Note that the socket module's timeout would be
> most beneficial to users of higher level modules (urllib[2]?, httplib,
> ftplib, etc), not directly by programmers.  To the best of my knowledge,
> none of these modules have been adapted to this new feature yet, so I think
> it's still a bit premature extrapolate from socket.defaulttimeout to
> unicode.errorhandling.  Also, as Phillip Eby pointed out, a UnicodeError
> generally results from an error in my code, not an intractable problem.
> (That's my experience, anyway.)

Sure.  So in your programs, keep the default.

But if someone has written a program and decides that they don't want
to deal with their (*their*!) errors by fixing the code, but rather
would continue to go with possibly broken data (and they may well know
enough about their application to know that that is harmless), why
should we not give them a way to do that?

AFAIK all the proposal does is give a way to change the default error
handling -- any code that sets an explicit error handling policy will
continue to receive exceptions.

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list