We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 184e0da commit 4c83626Copy full SHA for 4c83626
Lib/ntpath.py
@@ -348,7 +348,7 @@ def expanduser(path):
348
if 'USERPROFILE' in os.environ:
349
userhome = os.environ['USERPROFILE']
350
elif not 'HOMEPATH' in os.environ:
351
- return path
+ return os.path.normpath(path)
352
else:
353
try:
354
drive = os.environ['HOMEDRIVE']
@@ -375,7 +375,7 @@ def expanduser(path):
375
if isinstance(path, bytes):
376
userhome = os.fsencode(userhome)
377
378
- return userhome + path[i:]
+ return os.path.normpath(userhome) + path[i:]
379
380
381
# Expand paths containing shell variable substitutions.
0 commit comments