[I18n-sig] Modified open() builtin (Re: Python Character Model)

Paul Prescod paulp@ActiveState.com
Sun, 11 Feb 2001 13:49:38 -0800


"Barry A. Warsaw" wrote:
> 
> ...
> 
> I've barely followed this discussion at all, but what you say here
> causes my greatest nagging concern to bubble to the surface.  I write
> lots of programs for which i18n isn't a requirement, and may never be.
> It seems like you saying that you want me to have to confront issues
> like encodings, character sets, unicode, multiplicity of string types,
> etc. in even the simplest, most xenophobic programs I write.  That
> would be, IMO, a loss of epic proportions to the simplicity and "brain
> fitting" nature of Python.

file = open("/etc/passwd", "r", "ASCII")

Surely that is not such a terrible burden in the interests of making the
world a little bit less xenophobic! Once you do that, everything else
"just works" and when your program encounters data it can't handle in a
text file it will crash in a predictable way at a logical point (the
read function) instead of in an unpredictable way at an illogical point
(some random string coercion or API call).

 Paul Prescod