Skip to content
Open
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion Doc/library/site.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,13 @@ Module contents
was disabled by user request (with :option:`-s` or
:envvar:`PYTHONNOUSERSITE`). ``None`` means it was disabled for security
reasons (mismatch between user or group id and effective id) or by an
administrator.
administrator. Note that :func:`getusersitepackages` and :func:`getuserbase`
Copy link
Member

Choose a reason for hiding this comment

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

Let’s add some breathing space:

Suggested change
administrator. Note that :func:`getusersitepackages` and :func:`getuserbase`
administrator.
Note that :func:`getusersitepackages` and :func:`getuserbase`

don't take this variable into account. The check for :data:`ENABLE_USER_SITE` and
modification of ``sys.path`` occurs later. To disable user site-packages,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
modification of ``sys.path`` occurs later. To disable user site-packages,
modification of ``sys.path`` occur later. To disable user site-packages,

(two things occur)

users are encouraged to create :mod:`sitecustomize` or :mod:`usercustomize`,
rather than try to edit :file:`Lib/site.py`. Changing :file:`Lib/site.py`
Copy link
Member

Choose a reason for hiding this comment

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

You should refer to the site module, not to the Lib/site.py file that only exists with that name in cpython repo, not after installation 🙂

Copy link
Member

Choose a reason for hiding this comment

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

or maybe something like: rather than try to edit site.py to make it clear we’re talking about the file, not the module (which is something living in the memory of a python interpreter)

won't work unless recompile Python, but administrators should still be able
to set :data:`ENABLE_USER_SITE` in a :mod:`sitecustomize` module.
Copy link
Member

Choose a reason for hiding this comment

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

I would delete that last sentence, it repeats info.



.. data:: USER_SITE
Expand Down
Loading