[Python-Dev] [comp.lang.python] sys.setdefaultencoding (2.0b1)
Guido van Rossum
Fri, 15 Sep 2000 18:31:52 -0500
> I was just reading comp.lang.python and saw an interesting question
> that I couldn't answer. Is anyone here game?
From reading the source code for unicodeobject.c, _PyUnicode_Init()
sets the default to "ascii" anyway, to the call in site.py is quite
unnecessary. I think it's a good idea to remove it. (Look around
though -- there are some "if 0:" blocks that could make it necessary.
Maybe the setdefaultencoding() call should be inside an "if 0:" block
too. With a comment.
--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
> ------- Start of forwarded message -------
> From: Donn Cave <firstname.lastname@example.org>
> Newsgroups: comp.lang.python
> Subject: sys.setdefaultencoding (2.0b1)
> Date: 12 Sep 2000 22:11:31 GMT
> Organization: University of Washington
> Message-ID: <email@example.com>
> Mime-Version: 1.0
> Content-Type: text/plain; charset=ISO-8859-1
> I see codecs.c has gone to some trouble to defer character encoding
> setup until it's actually required for something, but it's required
> rather early in the process anyway when site.py calls
> If I strike that line from site.py, startup time goes down by about
> a third.
> Is that too simple a fix? Does setdefaultencoding("ascii") do something
> Donn Cave, firstname.lastname@example.org
> ------- End of forwarded message -------
> Python-Dev mailing list