mirror of
https://github.com/python/cpython.git
synced 2025-09-20 23:50:22 +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)
|
return normpath(path)
|
||||||
abspath = _abspath
|
abspath = _abspath
|
||||||
return _abspath(path)
|
return _abspath(path)
|
||||||
try:
|
if path: # Empty path must return current working directory.
|
||||||
path = win32api.GetFullPathName(path)
|
try:
|
||||||
except win32api.error:
|
path = win32api.GetFullPathName(path)
|
||||||
pass # Bad path - return unchanged.
|
except win32api.error:
|
||||||
|
pass # Bad path - return unchanged.
|
||||||
|
else:
|
||||||
|
path = os.getcwd()
|
||||||
return normpath(path)
|
return normpath(path)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue