mirror of
https://github.com/python/cpython.git
synced 2025-10-26 19:24:34 +00:00
bpo-38883: Don't use POSIX $HOME in pathlib.Path.home/expanduser on Windows (GH-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.
This commit is contained in:
parent
61f4db8c56
commit
c45a2aa9e2
3 changed files with 20 additions and 11 deletions
|
|
@ -253,9 +253,7 @@ def make_uri(self, path):
|
|||
return 'file:' + urlquote_from_bytes(path.as_posix().encode('utf-8'))
|
||||
|
||||
def gethomedir(self, username):
|
||||
if 'HOME' in os.environ:
|
||||
userhome = os.environ['HOME']
|
||||
elif 'USERPROFILE' in os.environ:
|
||||
if 'USERPROFILE' in os.environ:
|
||||
userhome = os.environ['USERPROFILE']
|
||||
elif 'HOMEPATH' in os.environ:
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue