Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-57684: Add -P cmdline option and PYTHONSAFEPATH env var #31542

Merged
merged 2 commits into from May 5, 2022

Commits on May 5, 2022

  1. pythongh-57684: Add -P cmdline option and PYTHONSAFEPATH env var

    Add the -P command line option and the PYTHONSAFEPATH environment
    variable to not prepend a potentially unsafe path to sys.path.
    
    * Add sys.flags.safe_path flag.
    * Add PyConfig.safe_path member.
    * Programs/_bootstrap_python.c uses config.safe_path=0.
    * Update subprocess._optim_args_from_interpreter_flags() to handle
      the -P command line option.
    * Modules/getpath.py sets safe_path to 1 if a "._pth" file is
      present.
    vstinner committed May 5, 2022
  2. Address Miro's review

    vstinner committed May 5, 2022