mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-106242: Fix path truncation in os.path.normpath (GH-106816)
This commit is contained in:
parent
607f18c894
commit
0932272431
5 changed files with 30 additions and 9 deletions
|
@ -460,6 +460,10 @@ class CommonTest(GenericTest):
|
|||
for path in ('', '.', '/', '\\', '///foo/.//bar//'):
|
||||
self.assertIsInstance(self.pathmodule.normpath(path), str)
|
||||
|
||||
def test_normpath_issue106242(self):
|
||||
for path in ('\x00', 'foo\x00bar', '\x00\x00', '\x00foo', 'foo\x00'):
|
||||
self.assertEqual(self.pathmodule.normpath(path), path)
|
||||
|
||||
def test_abspath_issue3426(self):
|
||||
# Check that abspath returns unicode when the arg is unicode
|
||||
# with both ASCII and non-ASCII cwds.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue