Commit d03b7757 authored by Tim Graham's avatar Tim Graham Committed by Steve Dower

bpo-31047: Fix ntpath.abspath to trim ending separator (GH-10082)

Regression in b0bf51b32240369ccb736dc32ff82bb96f375402.
parent e25d5fc1
......@@ -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)
......
......@@ -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')
......
Fix ``ntpath.abspath`` regression where it didn't remove a trailing
separator on Windows. Patch by Tim Graham.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment