[New-bugs-announce] [issue41376] site.getusersitepackages() incorrectly claims that PYTHONNOUSERSITE is respected

Phil Elson report at bugs.python.org
Thu Jul 23 11:22:11 EDT 2020


New submission from Phil Elson <pelson.pub at gmail.com>:

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)

----------
assignee: docs at python
components: Documentation
messages: 374139
nosy: docs at python, pelson
priority: normal
severity: normal
status: open
title: site.getusersitepackages() incorrectly claims that PYTHONNOUSERSITE is respected
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41376>
_______________________________________


More information about the New-bugs-announce mailing list