Skip to content

Doc: Add "the current working directory" to -I's description #100526

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Doc/using/cmdline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,9 @@ Miscellaneous options
Run Python in isolated mode. This also implies :option:`-E`, :option:`-P`
and :option:`-s` options.

In isolated mode :data:`sys.path` contains neither the script's directory nor
the user's site-packages directory. All :envvar:`PYTHON*` environment
In isolated mode, :data:`sys.path` does not contain the current working
directory, the script's directory, or the user's site-packages directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may add something like:

(...): see the :option:`-P option <-P>` for details.

Copy link
Contributor Author

@jiasli jiasli Jan 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is already indicated in L302~L303. Wouldn't this be a duplication?

In summary:

  • the current working directory, the script's directory comes from -P
  • the user's site-packages directory comes from -s
  • All :envvar:`PYTHON*` environment comes from -E

I am also wondering how to make it informative while being concise. 😂

Anyway, the point is, if the script's directory is mentioned, the current working directory should also be mentioned. Otherwise, they should all appear in the see ... for details part.

All :envvar:`PYTHON*` environment
variables are ignored, too. Further restrictions may be imposed to prevent
the user from injecting malicious code.

Expand Down