diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2023-08-11 18:13:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-11 18:13:46 (GMT) |
commit | 04cc01453db2f0af72a06440831637f8bf512daf (patch) | |
tree | 84854fa4bd5b10588eef404a2c22fe65ad25a244 /Lib/test/test_ntpath.py | |
parent | a39f0a350662f1978104ee1136472d784aa6f29c (diff) | |
download | cpython-04cc01453db2f0af72a06440831637f8bf512daf.zip cpython-04cc01453db2f0af72a06440831637f8bf512daf.tar.gz cpython-04cc01453db2f0af72a06440831637f8bf512daf.tar.bz2 |
gh-106844: Fix issues in _winapi.LCMapStringEx (GH-107832)
* Strings with length from 2**31-1 to 2**32-2 always caused MemoryError,
it doesn't matter how much memory is available.
* Strings with length exactly 2**32-1 caused OSError.
* Strings longer than 2**32-1 characters were truncated due to integer overflow bug.
* Strings containing the null character were truncated at the first null character.
Now strings longer than 2**31-1 characters caused OverflowError and the null character is allowed.
Diffstat (limited to 'Lib/test/test_ntpath.py')
-rw-r--r-- | Lib/test/test_ntpath.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index 538d758..78e1cb5 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -1036,6 +1036,7 @@ class PathLikeTests(NtpathTestCase): self._check_function(self.path.normcase) if sys.platform == 'win32': self.assertEqual(ntpath.normcase('\u03a9\u2126'), 'ωΩ') + self.assertEqual(ntpath.normcase('abc\x00def'), 'abc\x00def') def test_path_isabs(self): self._check_function(self.path.isabs) |