[New-bugs-announce] [issue45395] Frozen stdlib modules are discarded if custom frozen modules added.

Eric Snow report at bugs.python.org
Wed Oct 6 16:21:03 EDT 2021


New submission from Eric Snow <ericsnowcurrently at gmail.com>:

The mechanism to add custom frozen modules to the Python runtime is to set PyImport_FrozenModules (see Python/frozen.c) to some new array.  This means that the default frozen modules (from _PyImport_FrozenModules) are no longer used unless explicitly added to the custom array.  This is unlikely to be what the user wants.  It's especially problematic since it's easy to not realize this (or forget) and forgetting essential modules (like _frozen_importlib) will cause crashes.

It would probably make more sense to have PyImport_FrozenModules be an array of *additional* frozen modules, defaulting to an empty array.  Before going down that route we need to be sure that isn't going to break folks that are accommodating the existing behavior.

----------
components: Interpreter Core
messages: 403335
nosy: brett.cannon, eric.snow, lemburg
priority: normal
severity: normal
stage: needs patch
status: open
title: Frozen stdlib modules are discarded if custom frozen modules added.
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45395>
_______________________________________


More information about the New-bugs-announce mailing list