Skip to content

Conversation

@jiasli
Copy link
Contributor

@jiasli jiasli commented Dec 26, 2022

Per https://docs.python.org/3/using/cmdline.html#cmdoption-I, -I implies -P, and -P indicates "Don’t prepend the current working directory" when used with -m or -c:

image

The description of -I only mentions "the script's directory". "the current working directory" should be mentioned too.

@bedevere-bot bedevere-bot added awaiting review docs Documentation in the Doc dir skip news labels Dec 26, 2022
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.

@vstinner
Copy link
Member

vstinner commented Apr 5, 2023

I'm not sure how to rephrase this documentation. I'm not a documentation expert :-)

@python-cla-bot
Copy link

python-cla-bot bot commented Apr 18, 2025

The following commit authors need to sign the Contributor License Agreement:

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants