New submission from Eric Snow <ericsnowcurren...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue45395>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to