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:
Mark Hammond 2000-08-14 06:20:32 +00:00
parent 0d0b1e93e1
commit 647d2fe145
1 changed files with 7 additions and 4 deletions

View File

@ -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)