diff options
author | Mark Hammond <mhammond@skippinet.com.au> | 2000-08-14 06:20:32 (GMT) |
---|---|---|
committer | Mark Hammond <mhammond@skippinet.com.au> | 2000-08-14 06:20:32 (GMT) |
commit | 647d2fe1451b1e7cd558771fcbae3fbdce1ffcf7 (patch) | |
tree | fafa3d92612fb730bbf0d3a7b191012c17cc236d | |
parent | 0d0b1e93e1393b6a6661fe9837552812f2dbf781 (diff) | |
download | cpython-647d2fe1451b1e7cd558771fcbae3fbdce1ffcf7.zip cpython-647d2fe1451b1e7cd558771fcbae3fbdce1ffcf7.tar.gz cpython-647d2fe1451b1e7cd558771fcbae3fbdce1ffcf7.tar.bz2 |
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())
-rw-r--r-- | Lib/ntpath.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 034694d..f8334e5 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -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) |