mirror of
https://github.com/python/cpython.git
synced 2024-11-24 10:24:35 +08:00
Fix for Bug #110673: os.abspatth() now always returns os.getcwd() on Windows, if an empty path is specified. It previously did not if an empty path was delegated to win32api.GetFullPathName())
This commit is contained in:
parent
0d0b1e93e1
commit
647d2fe145
@ -416,8 +416,11 @@ def abspath(path):
|
||||
return normpath(path)
|
||||
abspath = _abspath
|
||||
return _abspath(path)
|
||||
try:
|
||||
path = win32api.GetFullPathName(path)
|
||||
except win32api.error:
|
||||
pass # Bad path - return unchanged.
|
||||
if path: # Empty path must return current working directory.
|
||||
try:
|
||||
path = win32api.GetFullPathName(path)
|
||||
except win32api.error:
|
||||
pass # Bad path - return unchanged.
|
||||
else:
|
||||
path = os.getcwd()
|
||||
return normpath(path)
|
||||
|
Loading…
Reference in New Issue
Block a user