From 647d2fe1451b1e7cd558771fcbae3fbdce1ffcf7 Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Mon, 14 Aug 2000 06:20:32 +0000 Subject: [PATCH] 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()) --- Lib/ntpath.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 034694ddb00..f8334e55183 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)