diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/ntpath.py | 2 | ||||
-rw-r--r-- | Lib/test/test_ntpath.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 0e6de28..11bb297 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -523,7 +523,7 @@ else: # use native Windows method on Windows def abspath(path): """Return the absolute version of a path.""" try: - return _getfullpathname(path) + return normpath(_getfullpathname(path)) except (OSError, ValueError): return _abspath_fallback(path) diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index f37a994..223e50f 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -284,6 +284,8 @@ class TestNtpath(unittest.TestCase): tester('ntpath.abspath("")', cwd_dir) tester('ntpath.abspath(" ")', cwd_dir + "\\ ") tester('ntpath.abspath("?")', cwd_dir + "\\?") + drive, _ = ntpath.splitdrive(cwd_dir) + tester('ntpath.abspath("/abc/")', drive + "\\abc") def test_relpath(self): tester('ntpath.relpath("a")', 'a') |