From: Guido van Rossum Date: Tue, 30 Nov 1999 15:00:00 +0000 (+0000) Subject: In abspath(), always use normpath(), even when win32api is available X-Git-Tag: v1.6a1~708 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6dfc792fea1cdf71dd601840c8832f917e89872d;p=python In abspath(), always use normpath(), even when win32api is available (and even when it fails). This avoids the problem where a trailing separator is not removed when win32api.GetFullPathName() is used. --- diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 75cbe4980d..11ba0602e4 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -404,10 +404,10 @@ def abspath(path): try: import win32api try: - return win32api.GetFullPathName(path) + path = win32api.GetFullPathName(path) except win32api.error: - return path # Bad path - return unchanged. + pass # Bad path - return unchanged. except ImportError: if not isabs(path): path = join(os.getcwd(), path) - return normpath(path) + return normpath(path)