Skip to content

Custom frozen modules get ignored. #89559

Closed

Description

@ericsnowcurrently
BPO 45396
Nosy @gvanrossum, @brettcannon, @ericsnowcurrently
PRs
  • bpo-45396: Always import custom frozen modules. #28776
  • bpo-45395: Make custom frozen modules additions instead of replacements. #28778
  • gh-89559: Change -X frozen_modules to -X frozen_stdlib. #29301
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ericsnowcurrently'
    closed_at = None
    created_at = <Date 2021-10-06.20:22:14.892>
    labels = ['interpreter-core', 'type-bug', '3.11']
    title = 'Custom frozen modules get ignored.'
    updated_at = <Date 2021-10-28.21:34:52.384>
    user = 'https://github.com/ericsnowcurrently'

    bugs.python.org fields:

    activity = <Date 2021-10-28.21:34:52.384>
    actor = 'eric.snow'
    assignee = 'eric.snow'
    closed = False
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2021-10-06.20:22:14.892>
    creator = 'eric.snow'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45396
    keywords = ['patch']
    message_count = 4.0
    messages = ['403336', '403337', '403705', '405277']
    nosy_count = 3.0
    nosy_names = ['gvanrossum', 'brett.cannon', 'eric.snow']
    pr_nums = ['28776', '28778', '29301']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue45396'
    versions = ['Python 3.11']

    Activity

    1. ericsnowcurrently commented on Oct 6, 2021

      @ericsnowcurrently
      MemberAuthor

      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.)

    2. added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      type-bugAn unexpected behavior, bug, or error
      3.11only security fixes
      on Oct 6, 2021
    3. ericsnowcurrently commented on Oct 6, 2021

      @ericsnowcurrently
      MemberAuthor

      (This was motivated by #28633 (comment).)

    4. gvanrossum commented on Oct 12, 2021

      @gvanrossum
      Member

      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.

    5. ericsnowcurrently commented on Oct 28, 2021

      @ericsnowcurrently
      MemberAuthor

      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.

    6. transferred this issue fromon Apr 10, 2022
    7. kumaraditya303 commented on Jul 27, 2022

      @kumaraditya303
      Contributor

      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.

      Do we still want to pursue this? I don't think we should change the name as it is been this way for the past beta and alphas.

    8. gvanrossum commented on Jul 27, 2022

      @gvanrossum
      Member

      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.

      Do we still want to pursue this? I don't think we should change the name as it is been this way for the past beta and alphas.

      Agreed, let's not change this. Closing as "fixed" because everything else is taken care of.

    9. erlend-aasland commented on Jul 27, 2022

      @erlend-aasland
      Contributor

      I assume this implies also closing the linked open PR. I'm marking it as pending close.

    10. gvanrossum commented on Jul 27, 2022

      @gvanrossum
      Member

      Yes please.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Labels

    3.11only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions