diff options
author | Steve Dower <steve.dower@python.org> | 2023-08-16 23:19:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-16 23:19:48 (GMT) |
commit | ede98958810b76694cf756d305b564cd6adc1a48 (patch) | |
tree | 89b00419836960b648ab4104277db32c45e9ad14 /Lib/test/test_genericpath.py | |
parent | 2a00cf2db8a19533dc7d71276ce6a77f6a103c65 (diff) | |
download | cpython-ede98958810b76694cf756d305b564cd6adc1a48.zip cpython-ede98958810b76694cf756d305b564cd6adc1a48.tar.gz cpython-ede98958810b76694cf756d305b564cd6adc1a48.tar.bz2 |
[3.12] gh-106242: Fix path truncation in os.path.normpath (GH-106816) (#107981)
* gh-106242: Fix path truncation in os.path.normpath (GH-106816)
* gh-106242: Minor fixup to avoid compiler warnings
---------
Co-authored-by: Finn Womack <flan313@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test/test_genericpath.py')
-rw-r--r-- | Lib/test/test_genericpath.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py index 489044f..4f311c2 100644 --- a/Lib/test/test_genericpath.py +++ b/Lib/test/test_genericpath.py @@ -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. |