diff Lib/test/string_tests.py @ 17749:f465cae301ee legacy-trunk

SF bug #422088: [OSF1 alpha] string.replace(). Platform blew up on "123".replace("123", ""). Michael Hudson pinned the blame on platform malloc(0) returning NULL. This is a candidate for all bugfix releases.
author Tim Peters <tim.peters@gmail.com>
date Wed, 09 May 2001 23:00:26 +0000
parents eee67a84e5fa
children 9ea87c0a7c04
line wrap: on
line diff
--- a/Lib/test/string_tests.py	Wed May 09 22:15:03 2001 +0000
+++ b/Lib/test/string_tests.py	Wed May 09 23:00:26 2001 +0000
@@ -177,6 +177,12 @@
     test('replace', 'one!two!three!', 'one@two@three@', '!', '@')
     test('replace', 'one!two!three!', 'one!two!three!', 'x', '@')
     test('replace', 'one!two!three!', 'one!two!three!', 'x', '@', 2)
+    # Next three for SF bug 422088: [OSF1 alpha] string.replace(); died with
+    # MemoryError due to empty result (platform malloc issue when requesting
+    # 0 bytes).
+    test('replace', '123', '', '123', '')
+    test('replace', '123123', '', '123', '')
+    test('replace', '123x123', 'x', '123', '')
 
     test('startswith', 'hello', 1, 'he')
     test('startswith', 'hello', 1, 'hello')