[Python-Dev] What's required to keep OS/2 support in Python 3.3

Antoine Pitrou solipsis at pitrou.net
Fri Jan 6 21:28:29 CET 2012


On Sat, 07 Jan 2012 06:28:00 +1030
Paul Smedley <paul at smedley.id.au> wrote:
> 
> I now have a dll and exe - however when it tried to build the modules, 
> it dies with:
> Could not find platform independent libraries <prefix>
> Could not find platform dependent libraries <exec_prefix>
> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
> Fatal Python error: Py_Initialize: Unable to get the locale encoding

I would look at this line:

> LookupError: no codec search functions registered: can't find encoding

Normally the standard codec search function is registered when
importing the "encodings" module (see Lib/encodings/__init__.py), which
is done at the end of _PyCodecRegistry_Init() in Python/codecs.c.
There's this comment there:

            /* Ignore ImportErrors... this is done so that
               distributions can disable the encodings package. Note
               that other errors are not masked, e.g. SystemErrors
               raised to inform the user of an error in the Python
               configuration are still reported back to the user. */

For the purpose of debugging you could *not* ignore the error and
instead print it out or bail out.

Regards

Antoine.




More information about the Python-Dev mailing list