mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +00:00
bpo-31047: Fix ntpath.abspath for invalid paths (GH-8544)
This commit is contained in:
parent
b7fd73896d
commit
d2e902e4fb
3 changed files with 26 additions and 22 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue