[New-bugs-announce] [issue45324] The frozen importer should capture info in find_spec().

Eric Snow report at bugs.python.org
Wed Sep 29 13:57:04 EDT 2021


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

Currently FrozenImporter (in Lib/importlib/_bootstrap.py) does minimal work in its find_spec() method.  It only checks whether or not the module is frozen.  However, in doing so it has gathered all the info we need to load the module.  We end up repeating that work in exec_module().

Rather than duplicating that effort, we should preserve the info in spec.loader_state.  This has the added benefit of aligning more closely with the division between finder and loader.  Once we get to the loader, there shouldn't be a need to check if the module is frozen nor otherwise interact with the internal frozen module state (i.e. PyImport_FrozenModules).

----------
assignee: eric.snow
components: Interpreter Core
messages: 402895
nosy: eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: The frozen importer should capture info in find_spec().
type: behavior
versions: Python 3.11

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


More information about the New-bugs-announce mailing list