[Python-Dev] Startup overhead due to codec usage

Martin v. L÷wis martin@v.loewis.de
18 Apr 2003 13:33:17 +0200


"M.-A. Lemburg" <mal@lemburg.com> writes:

> Hmm, then we should fix this and the site.py lookup you
> introduced. I don't see the point in increasing startup
> time for all scripts just because a seldom used feature needs
> initialization.

I really don't see the need to fix anything here. I wouldn't mind
somebody else fixing something, as long as none of the features break.

> BTW, I wonder what happens if you run a Python version with
> Unicode disabled in the current scenario.

The nl_langinfo code in Python/pythonrun.c is disabled when unicode is
disabled. In turn, it won't be executed, and
Py_FileSystemDefaultEncoding stays at NULL. This is no problem, as it
is never used, anyway.

For the code in site.py (I think), finding the codec will fail with an
exception, which will be caught, and the "mbcs" alias will be added.

Regards,
Martin