classification
Title: site.getusersitepackages() incorrectly claims that PYTHONNOUSERSITE is respected
Type: Stage: resolved
Components: Documentation Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, methane, miss-islington, pablogsal, pelson
Priority: normal Keywords: patch

Created on 2020-07-23 15:22 by pelson, last changed 2020-10-11 18:35 by pablogsal. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 21602 merged pelson, 2020-07-23 15:27
PR 22591 merged miss-islington, 2020-10-08 06:38
PR 22592 merged miss-islington, 2020-10-08 06:38
Messages (4)
msg374139 - (view) Author: Phil Elson (pelson) * Date: 2020-07-23 15:22
The documentation for site.getusersitepackages() states at https://docs.python.org/3.10/library/site.html#site.getusersitepackages:

Return the path of the user-specific site-packages directory, USER_SITE. If it is not initialized yet, this function will also set it, respecting PYTHONNOUSERSITE and USER_BASE.


Yet the implementation does not agree:


```
$ python  -c "import site; print(site.getusersitepackages())"
/home/user/.local/lib/python3.7/site-packages

$ PYTHONNOUSERSITE=1 python -c "import site; print(site.getusersitepackages())"
/home/user/.local/lib/python3.7/site-packages
```

(same result for -s and -I flags)
msg378215 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2020-10-08 06:38
New changeset 35f041dd0171f575fc3adce1709b31fdf45a5ff6 by Phil Elson in branch 'master':
bpo-41376: Fix the documentation of `site.getusersitepackages()` (GH-21602)
https://github.com/python/cpython/commit/35f041dd0171f575fc3adce1709b31fdf45a5ff6
msg378219 - (view) Author: miss-islington (miss-islington) Date: 2020-10-08 07:00
New changeset 5b1fdcacfc36dfe36693f4c350c958df6600de14 by Miss Skeleton (bot) in branch '3.9':
bpo-41376: Fix the documentation of `site.getusersitepackages()` (GH-21602)
https://github.com/python/cpython/commit/5b1fdcacfc36dfe36693f4c350c958df6600de14
msg378444 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2020-10-11 18:21
New changeset 1006f63a8b4327e8a74eb978b175b5234bb46c6c by Miss Skeleton (bot) in branch '3.8':
bpo-41376: Fix the documentation of `site.getusersitepackages()` (GH-21602) (GH-22592)
https://github.com/python/cpython/commit/1006f63a8b4327e8a74eb978b175b5234bb46c6c
History
Date User Action Args
2020-10-11 18:35:11pablogsalsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-10-11 18:21:38pablogsalsetnosy: + pablogsal
messages: + msg378444
2020-10-08 07:00:38miss-islingtonsetmessages: + msg378219
2020-10-08 06:38:21miss-islingtonsetpull_requests: + pull_request21581
2020-10-08 06:38:12miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request21580
2020-10-08 06:38:05methanesetnosy: + methane
messages: + msg378215
2020-08-24 19:33:05steve.dowersetversions: - Python 3.5, Python 3.6, Python 3.7
2020-07-23 15:27:48pelsonsetkeywords: + patch
stage: patch review
pull_requests: + pull_request20740
2020-07-23 15:22:11pelsoncreate