Skip to content

-X frozen_modules=on|off should be configurable with environment variable #98697

Closed as not planned
@virtuald

Description

@virtuald

Feature or enhancement

-X frozen_modules=on|off should be configurable with environment variable

Pitch

The crossenv project provides the ability to generate virtualenvs that are customized to allow very simple cross-compilation, by mixing pieces of a host-native python and the right configuration variables from a cross-compiled python. Python 3.11 broke it in a few ways, but in particular the way that it injects its hooks is by overriding the contents of site.py, which is now included in a frozen module by default. To allow the patching to continue working, we have to add the -X option to the python command line each time it starts. This is doable, but it would be much simpler if we could just set an environment variable to disable the frozen modules.

Many other -X options are configurable through an environment variable, it seems like this one should too. Maybe PYUSEFROZENMODULES=0|1?

Note: yes, crossenv does a lot of dirty tricks to do its work, but I've tried several cross-compilation approaches and it's the easiest I've used by far.

Previous discussion

No prior discussion, seems like a small enough feature that is an easy yes/no?

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-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