Skip to content

Commit 47b41d8

Browse files
committed
Add whatsnew PR release note regarding pythonsafepath
1 parent bb8b2ba commit 47b41d8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Respect PYTHONSAFEPATH
2+
======================
3+
4+
IPython now respects the value of Python's flag ``sys.flags.safe_path``, a flag which is most often set by the ``PYTHONSAFEPATH`` environment variable. Setting this causes Python not to automatically include the current working directory in the sys.path.
5+
6+
IPython can already be configured to do this via the ``--ignore_cwd`` command-line flag or by setting ``c.InteractiveShellApp.ignore_cwd=True``. Now, IPython can also be configured by setting ``PYTHONSAFEPATH=1`` or by calling python with ``-P``.
7+
8+
The behavior of ``safe_path`` was described in `what's new in 3.11`_ and in `PyConfig docs`_.
9+
10+
11+
.. _what's new in 3.11: https://docs.python.org/3/whatsnew/3.11.html#whatsnew311-pythonsafepath
12+
.. _PyConfig docs: https://docs.python.org/3/c-api/init_config.html#c.PyConfig.safe_path
13+
14+

0 commit comments

Comments
 (0)