GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support configuring -X frozen_modules=on|off using an environment variable. · Issue #111374 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
Closed
Support configuring -X frozen_modules=on|off using an environment variable.#111374
Copy link
Assignees
gpshead
Labels
3.13only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement

Description

@yilei
yilei
opened on Oct 27, 2023
Issue body actions

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

  • gh-111374: Add a new PYTHON_FROZEN_MODULES env var, equivalent of -X frozen_modules. #111411
Reacted by Gregory P. Smith

Activity

  1. yilei
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Oct 27, 2023
  2. yilei
    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
  3. yilei commented on Oct 27, 2023

    @yilei
    yilei
    on Oct 27, 2023
    ContributorAuthor
    More actions

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

  4. hugovk commented on Oct 28, 2023

    @hugovk
    hugovk
    on Oct 28, 2023
    Member
    More actions

    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

    Reacted by Gregory P. Smith, Yilei and Donghee Na
  5. gpshead
    self-assigned this
    on Oct 28, 2023
  6. gpshead
    added
    3.13only security fixesonly security fixes
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Nov 1, 2023
  7. gpshead
    added a commit that references this issue on Nov 1, 2023

    gh-111374: Add a new PYTHON_FROZEN_MODULES env var, equivalent of `-X…

    45a36d5
  8. FullteaR
    added a commit that references this issue on Nov 3, 2023

    pythongh-111374: Add a new PYTHON_FROZEN_MODULES env var, equivalent …

    2abb283
  9. hugovk commented on Nov 9, 2023

    @hugovk
    hugovk
    on Nov 9, 2023
    Member
    More actions

    Thank you for your contribution!

  10. hugovk
    closed this as completedon Nov 9, 2023
  11. aisk
    added a commit that references this issue on Feb 11, 2024

    pythongh-111374: Add a new PYTHON_FROZEN_MODULES env var, equivalent …

    d2fd318
  12. Glyphack
    added a commit that references this issue on Sep 2, 2024

    pythongh-111374: Add a new PYTHON_FROZEN_MODULES env var, equivalent …

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

Metadata

Metadata

Assignees

  • @gpshead
    gpshead

Labels

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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.