classification
Title: Path.home() should ignore HOME env var like os.path.expanduser()
Type: Stage: patch review
Components: Library (Lib) Versions: Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Anthony Sottile, BTaskaya, brett.cannon, lazka, steve.dower
Priority: normal Keywords: patch

Created on 2019-11-21 18:45 by lazka, last changed 2020-01-12 09:23 by lazka.

Pull Requests
URL Status Linked Edit
PR 17961 open lazka, 2020-01-12 09:23
Messages (1)
msg357196 - (view) Author: Christoph Reiter (lazka) * Date: 2019-11-21 18:45
In issue36264 os.path.expanduser() was changed to no longer use the HOME environment variable on Windows.

There are two more ways in the stdlib to get the user directory, pathlib.Path.home() and pathlib.Path.expanduser() which internally use gethomedir() which still uses the HOME environment variable:

https://github.com/python/cpython/blob/0aca3a3a1e68b4ca2d334ab5255dfc267719096e/Lib/pathlib.py#L255

Since they are documented to work the same as os.path.expanduser() they should be changed to no longer use HOME as well.
History
Date User Action Args
2020-01-12 09:23:37lazkasetkeywords: + patch
stage: patch review
pull_requests: + pull_request17369
2019-11-21 21:00:37brett.cannonsetnosy: + brett.cannon
2019-11-21 18:54:56Anthony Sottilesetnosy: + Anthony Sottile
2019-11-21 18:54:50BTaskayasetversions: + Python 3.8
2019-11-21 18:52:36BTaskayasetnosy: + steve.dower, BTaskaya

versions: + Python 3.9, - Python 3.8
2019-11-21 18:45:12lazkacreate