[New-bugs-announce] [issue38883] Path.home() should ignore HOME env var like os.path.expanduser()

Christoph Reiter report at bugs.python.org
Thu Nov 21 13:45:12 EST 2019


New submission from Christoph Reiter <reiter.christoph at gmail.com>:

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.

----------
components: Library (Lib)
messages: 357196
nosy: lazka
priority: normal
severity: normal
status: open
title: Path.home() should ignore HOME env var like os.path.expanduser()
versions: Python 3.8

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


More information about the New-bugs-announce mailing list