Skip to content

Commit 0e6584d

Browse files
committed
docs: note that PYTHONEXECUTABLE is respected with -E/-I options
1 parent dbee142 commit 0e6584d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Doc/using/cmdline.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ source.
107107

108108
:option:`-I` option can be used to run the script in isolated mode where
109109
:data:`sys.path` contains neither the current directory nor the user's
110-
site-packages directory. All ``PYTHON*`` environment variables are
111-
ignored, too.
110+
site-packages directory. All ``PYTHON*`` environment variables (except
111+
`PYTHONEXECUTABLE`) are ignored, too.
112112

113113
Many standard library modules contain code that is invoked on their execution
114114
as a script. An example is the :mod:`timeit` module::
@@ -165,8 +165,8 @@ source.
165165

166166
:option:`-I` option can be used to run the script in isolated mode where
167167
:data:`sys.path` contains neither the script's directory nor the user's
168-
site-packages directory. All ``PYTHON*`` environment variables are
169-
ignored, too.
168+
site-packages directory. All ``PYTHON*`` environment variables (except
169+
`PYTHONEXECUTABLE`) are ignored, too.
170170

171171
.. audit-event:: cpython.run_file filename
172172

@@ -285,7 +285,7 @@ Miscellaneous options
285285

286286
.. option:: -E
287287

288-
Ignore all ``PYTHON*`` environment variables, e.g.
288+
Ignore all ``PYTHON*`` environment variables (except `PYTHONEXECUTABLE), e.g.
289289
:envvar:`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set.
290290

291291
See also the :option:`-P` and :option:`-I` (isolated) options.
@@ -939,8 +939,8 @@ conflict.
939939
.. envvar:: PYTHONEXECUTABLE
940940

941941
If this environment variable is set, ``sys.argv[0]`` will be set to its
942-
value instead of the value got through the C runtime. Only works on
943-
macOS.
942+
value instead of the value got through the C runtime. This environment
943+
variable isn't ignored by the `-E` and `-I` options.
944944

945945
.. envvar:: PYTHONWARNINGS
946946

0 commit comments

Comments
 (0)