mirror of
https://github.com/python/cpython.git
synced 2025-10-07 15:42:02 +00:00
bpo-46208: Fix normalization of relative paths in _Py_normpath()/os.path.normpath (GH-30362)
This commit is contained in:
parent
9925e70e48
commit
9c5fa9c97c
4 changed files with 43 additions and 9 deletions
|
@ -235,6 +235,15 @@ class TestNtpath(NtpathTestCase):
|
|||
|
||||
tester("ntpath.normpath('\\\\.\\NUL')", r'\\.\NUL')
|
||||
tester("ntpath.normpath('\\\\?\\D:/XY\\Z')", r'\\?\D:/XY\Z')
|
||||
tester("ntpath.normpath('handbook/../../Tests/image.png')", r'..\Tests\image.png')
|
||||
tester("ntpath.normpath('handbook/../../../Tests/image.png')", r'..\..\Tests\image.png')
|
||||
tester("ntpath.normpath('handbook///../a/.././../b/c')", r'..\b\c')
|
||||
tester("ntpath.normpath('handbook/a/../..///../../b/c')", r'..\..\b\c')
|
||||
|
||||
tester("ntpath.normpath('//server/share/..')" , '\\\\server\\share\\')
|
||||
tester("ntpath.normpath('//server/share/../')" , '\\\\server\\share\\')
|
||||
tester("ntpath.normpath('//server/share/../..')", '\\\\server\\share\\')
|
||||
tester("ntpath.normpath('//server/share/../../')", '\\\\server\\share\\')
|
||||
|
||||
def test_realpath_curdir(self):
|
||||
expected = ntpath.normpath(os.getcwd())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue