Uh oh!
There was an error while loading. Please reload this page.
gh-152228: Fix an assertion failure in str.replace under a limited memory case - #152229
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Stan Ulbrych <stan@python.org>
sobolevn
commented
Jun 25, 2026
Created #152236 to track |
| @@ -0,0 +1 @@ | |||
| Fix a crash in :meth:`str.replace` under a limited memory situation. | |||
There was a problem hiding this comment.
I wouldn't call it a "crash". It's "only" an assertion failure when Python is built in debug mode.
str.replace under a limited memory casestr.replace under a limited memory casevstinner
commented
Jun 29, 2026
Strange, CI tests pass, but test_str fails when I download the PR locally: Do it work on your machine? The "Squash and merge" should work around the issue anyway. |
sobolevn
commented
Jun 29, 2026
Looks like a forgot to push the merge commit. Did it now :) |
vstinner
commented
Jun 29, 2026
But it's strange that tests passed on the CI (without the merge commit). |
sobolevn
commented
Jun 29, 2026
Uh oh!
There was an error while loading. Please reload this page.
Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
GH-152615 is a backport of this pull request to the 3.15 branch. |
GH-152616 is a backport of this pull request to the 3.14 branch. |
GH-152617 is a backport of this pull request to the 3.13 branch. |

Because test was simple enough and was always
0as the memory limit, I decided to include it.str.replacecan crash under memory pressure #152228