[Python-Dev] global encoding?!? (was: [Python-checkins] ... unicodeobject.c)

Greg Stein gstein@lyra.org
Tue, 9 May 2000 13:14:19 -0700 (PDT)

On Tue, 9 May 2000, Fred Drake wrote:
> Update of /projects/cvsroot/python/dist/src/Objects
> In directory seahag.cnri.reston.va.us:/home/fdrake/projects/python/Objects
> Modified Files:
> 	unicodeobject.c 
> Log Message:
> M.-A. Lemburg <mal@lemburg.com>:
> Added support for user settable default encodings. The
> current implementation uses a per-process global which
> defines the value of the encoding parameter in case it
> is set to NULL (meaning: use the default encoding).

Umm... maybe I missed something, but I thought there was pretty broad
feelings *against* having a global like this. This kind of thing is just

1) Python modules can't change it, nor can they rely on it being a
   particular value
2) a mutable, global variable is just plain wrong. The InterpreterState
   and ThreadState structures were created *specifically* to avoid adding
   crap variables like this.
3) allowing a default other than utf-8 is sure to cause gotchas and
   surprises. Some code is going to rightly assume that the default is
   just that, but be horribly broken when an application changes it.

Somebody please say this is hugely experimental. And then say why it isn't
just a private patch, rather than sitting in CVS.



Greg Stein, http://www.lyra.org/