Skip to content

Commit 462dddf

Browse files
committed
Add test case
1 parent f0d20b2 commit 462dddf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/string_tests.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,13 @@ def test_replace(self):
767767
self.checkraises(TypeError, 'hello', 'replace', 42, 'h')
768768
self.checkraises(TypeError, 'hello', 'replace', 'h', 42)
769769

770+
# gh-127971
771+
any_3_nonblank_codepoints = '!!!'
772+
seven_codepoints = any_3_nonblank_codepoints + ' ' + any_3_nonblank_codepoints
773+
a = (' ' * 243) + seven_codepoints + (' ' * 7)
774+
b = ' ' * 6 + chr(256)
775+
a.replace(seven_codepoints, b)
776+
770777
def test_replace_uses_two_way_maxcount(self):
771778
# Test that maxcount works in _two_way_count in fastsearch.h
772779
A, B = "A"*1000, "B"*1000

0 commit comments

Comments
 (0)