This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Custom frozen modules get ignored.
Type: behavior Stage: patch review
Components: Interpreter Core Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: eric.snow Nosy List: brett.cannon, eric.snow, gvanrossum
Priority: normal Keywords: patch

Created on 2021-10-06 20:22 by eric.snow, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 28776 closed eric.snow, 2021-10-06 20:34
PR 28778 eric.snow, 2021-10-28 20:23
PR 29301 open eric.snow, 2021-10-28 21:25
Messages (4)
msg403336 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2021-10-06 20:22
Recently we added the "-X frozen_modules" CLI option to control whether or not (non-essential) frozen modules get used.  Currently the default is "off", though the plan is to make the default "on".  Regardless, this is problematic for executables with custom frozen modules (where PyImport_FrozenModules is overridden).  If there are custom frozen modules then they should always be used.

Note that there are already other problems with custom frozen modules, to be addressed separately.  (See bpo-45395.)
msg403337 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2021-10-06 20:24
(This was motivated by https://github.com/python/cpython/pull/28633#discussion_r720506225.)
msg403705 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2021-10-12 00:01
I'm not convinced by the comment you linked to.

It seems Brett is referring to the case where at the C level someone overrides `PyImport_FrozenModules` (a global in frozen.c) -- though it is never explicitly named in the thread. And that variable *is* ignored when the -X flag is set to off (at least, it is ignored when use_frozen() is false and we're not talking about an "essensial" frozen module; and I think use_frozen() corresponds to whether the -X flag is on or off, or its default). So I think the -X flag is named correctly.
msg405277 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2021-10-28 21:30
The behavior has been addressed in the fix for bpo-45395.  However, I'd like to change the name of the -X option from "frozen_modules" to "frozen_stdlib", to avoid any confusion in the future.  After that this issue is done.
History
Date User Action Args
2022-04-11 14:59:50adminsetgithub: 89559
2021-10-28 21:34:52eric.snowsetstatus: closed -> open
resolution: fixed ->
stage: resolved -> patch review
2021-10-28 21:30:27eric.snowsetstatus: open -> closed
resolution: fixed
messages: + msg405277

stage: patch review -> resolved
2021-10-28 21:25:51eric.snowsetpull_requests: + pull_request27565
2021-10-28 20:23:09eric.snowsetpull_requests: + pull_request27560
2021-10-12 00:01:17gvanrossumsetnosy: + gvanrossum
messages: + msg403705
2021-10-06 20:34:59eric.snowsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request27110
2021-10-06 20:24:43eric.snowsetmessages: + msg403337
2021-10-06 20:22:14eric.snowcreate