[New-bugs-announce] [issue13722] "distributions can disable the encodings package"

Antoine Pitrou report at bugs.python.org
Fri Jan 6 21:32:22 CET 2012

New submission from Antoine Pitrou <pitrou at free.fr>:

In _PyCodecRegistry_Init() (in Python/codecs.c), it is attempted to import the encodings module (so that the default search function gets registered) and failures get ignored following the same reasoning:

            /* 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. */

However, it is unlikely for Python 3 to start up at all without an encodings package (we needs some codecs to initialize stdio). Also, I'm not sure what the point would be. Distributions can simply distribute a dummy encodings module if they really want to disable the default encodings.
Not silencing the error would probably make it easier to diagnose early import issues.

components: Interpreter Core
messages: 150767
nosy: amaury.forgeotdarc, loewis, pitrou
priority: low
severity: normal
status: open
title: "distributions can disable the encodings package"
versions: Python 3.3

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list