Skip to content

Support configuring -X frozen_modules=on|off using an environment variable. #111374

Closed

Description

@yilei

Feature or enhancement

Proposal:

Most of the -X options (https://docs.python.org/3/using/cmdline.html#cmdoption-X) can be configured via an environment variable, but not -X frozen_modules.

This makes it harder for environments that you don't have the control over the flags passed to the Python interpreter.

#98697 also includes a use case for crossenv, but the issue was closed because it was not in time for Python 3.11.

I'm proposing a PYTHONFROZENMODULES PYTHON_FROZEN_MODULES environment variable to be added for Python 3.13, which has the equivalent meaning of using -X frozen_modules.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

#98697 is the same request, but closed due to not in time for Python 3.11.

Linked PRs

Activity

  1. changed the title [-]Support configuring frozen_module=on|off using an environment variable.[/-] [+]Support configuring -X frozen_modules=on|off using an environment variable.[/+] on Oct 27, 2023
  2. yilei commented on Oct 27, 2023

    @yilei
    ContributorAuthor

    Btw, I'll also send a PR, assuming this will be accepted.

  3. hugovk commented on Oct 28, 2023

    @hugovk
    Member

    I'm proposing a PYTHONFROZENMODULES environment variable to be added for Python 3.13, which has the equivalent meaning of using -X frozen_modules.

    I'll let others review the PR, but if we do this, let's add underscores to the name:

    • PYTHON_FROZEN_MODULES

    See https://discuss.python.org/t/change-environment-variable-style/35180?u=hugovk

  4. self-assigned this
    on Oct 28, 2023
  5. added
    3.13only security fixes
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    on Nov 1, 2023
  6. added a commit that references this issue on Nov 1, 2023
  7. added a commit that references this issue on Nov 3, 2023
  8. hugovk commented on Nov 9, 2023

    @hugovk
    Member

    Thank you for your contribution!

  9. added a commit that references this issue on Feb 11, 2024
  10. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.13only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions