[3.8] bpo-38883: Don't use POSIX `$HOME` in `pathlib.Path.home/expanduser` on Windows (GH-17961) by miss-islington · Pull Request #18229 · python/cpython

@lazka @miss-islington

…on Windows (pythonGH-17961)

In bpo-36264 os.path.expanduser was changed to ignore HOME on Windows.

Path.expanduser/home still honored HOME despite being documented as behaving the same
as os.path.expanduser. This makes them also ignore HOME so that both implementations
behave the same way again.
(cherry picked from commit c45a2aa)

Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>