bpo-31047: Fix ntpath.abspath for invalid paths (GH-8544)

This commit is contained in:
Franz Wöllert 2018-07-29 14:47:09 +02:00 committed by Steve Dower
parent b7fd73896d
commit d2e902e4fb
3 changed files with 26 additions and 22 deletions

View file

@ -280,6 +280,10 @@ class TestNtpath(unittest.TestCase):
@unittest.skipUnless(nt, "abspath requires 'nt' module")
def test_abspath(self):
tester('ntpath.abspath("C:\\")', "C:\\")
with support.temp_cwd(support.TESTFN) as cwd_dir: # bpo-31047
tester('ntpath.abspath("")', cwd_dir)
tester('ntpath.abspath(" ")', cwd_dir + "\\ ")
tester('ntpath.abspath("?")', cwd_dir + "\\?")
def test_relpath(self):
tester('ntpath.relpath("a")', 'a')