Skip to content

Commit 5f29268

Browse files
authored
gh-57684: Document safe path in What's New in Python 3.11 (#92362)
Mention also -P and PYTHONSAFEPATH in the Security Considerations page.
1 parent 329afe7 commit 5f29268

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Doc/library/security_warnings.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ The following modules have specific security considerations:
3232
* :mod:`xml`: :ref:`XML vulnerabilities <xml-vulnerabilities>`
3333
* :mod:`zipfile`: :ref:`maliciously prepared .zip files can cause disk volume
3434
exhaustion <zipfile-resources-limitations>`
35+
36+
The :option:`-I` command line option can be used to run Python in isolated
37+
mode. When it cannot be used, the :option:`-P` option or the
38+
:envvar:`PYTHONSAFEPATH` environment variable can be used to not prepend a
39+
potentially unsafe path to :data:`sys.path` such as the current directory, the
40+
script's directory or an empty string.

Doc/whatsnew/3.11.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ New typing features:
7979
* :pep:`673`: ``Self`` type.
8080
* :pep:`675`: Arbitrary literal string type.
8181

82+
Security improvements:
83+
84+
* New :option:`-P` command line option and :envvar:`PYTHONSAFEPATH` environment
85+
variable to not prepend a potentially unsafe path to :data:`sys.path` such as
86+
the current directory, the script's directory or an empty string.
87+
8288

8389
New Features
8490
============

0 commit comments

Comments
 (0)