mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00: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
1 changed files with 7 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue