-
- Downloads
gh-57684: Add -P cmdline option and PYTHONSAFEPATH env var (#31542)
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.
Showing
- Doc/c-api/init_config.rst 37 additions, 9 deletionsDoc/c-api/init_config.rst
- Doc/library/sys.rst 16 additions, 8 deletionsDoc/library/sys.rst
- Doc/using/cmdline.rst 30 additions, 1 deletionDoc/using/cmdline.rst
- Doc/whatsnew/3.11.rst 10 additions, 0 deletionsDoc/whatsnew/3.11.rst
- Include/cpython/initconfig.h 1 addition, 0 deletionsInclude/cpython/initconfig.h
- Lib/subprocess.py 4 additions, 2 deletionsLib/subprocess.py
- Lib/test/test_cmd_line.py 6 additions, 4 deletionsLib/test/test_cmd_line.py
- Lib/test/test_embed.py 11 additions, 2 deletionsLib/test/test_embed.py
- Lib/test/test_support.py 3 additions, 1 deletionLib/test/test_support.py
- Lib/test/test_sys.py 2 additions, 2 deletionsLib/test/test_sys.py
- Misc/NEWS.d/next/Security/2022-05-04-14-32-24.gh-issue-57684.HrlDrM.rst 3 additions, 0 deletions...xt/Security/2022-05-04-14-32-24.gh-issue-57684.HrlDrM.rst
- Misc/python.man 13 additions, 1 deletionMisc/python.man
- Modules/getpath.py 1 addition, 0 deletionsModules/getpath.py
- Modules/main.c 1 addition, 1 deletionModules/main.c
- Programs/_bootstrap_python.c 1 addition, 0 deletionsPrograms/_bootstrap_python.c
- Programs/_testembed.c 9 additions, 1 deletionPrograms/_testembed.c
- Python/dynload_win.c 0 additions, 1 deletionPython/dynload_win.c
- Python/getopt.c 1 addition, 1 deletionPython/getopt.c
- Python/initconfig.c 22 additions, 0 deletionsPython/initconfig.c
- Python/sysmodule.c 3 additions, 1 deletionPython/sysmodule.c
Loading
Please register or sign in to comment