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

M.-A. Lemburg mal@lemburg.com
Mon, 12 Feb 2001 17:15:21 +0100

"Barry A. Warsaw" wrote:
> >>>>> "TE" == Tom Emerson <tree@basistech.com> writes:
>     TE> What if it were possible to specify the "default" encoding at
>     TE> configure time, while keeping the argument to open()
>     TE> optional. Ruby does this, as does MySQL, so there *is*
>     TE> precedent.
> That's a little scary because then Python programs may cease to be
> portable.  Moderately better would be an API to select the default
> encoding at runtime, but that's still worrisome.

A default value for encoding wouldn't work, since not all files
you open are text files. The only reasonable default for the
encoding parameter is 'binary'.

Marc-Andre Lemburg
Company:                                        http://www.egenix.com/
Consulting:                                    http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/