From: Mark Hammond Date: Mon, 14 Aug 2000 06:20:32 +0000 (+0000) Subject: Fix for Bug #110673: os.abspatth() now always returns os.getcwd() on Windows, if... X-Git-Tag: v2.0b1~467 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=647d2fe1451b1e7cd558771fcbae3fbdce1ffcf7;p=thirdparty%2FPython%2Fcpython.git 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()) --- diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 034694ddb00b..f8334e55183c 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)