Serhiy Storchaka added the comment: Here is modified patch. In new code we try to avoid integer wrap around. It is safer to raise MemoryError right after PyMem_MALLOC(), otherwise it would possible to reraise unrelated exception instead MemoryError if strop.replace() is called without clearing current exception (should never happen, but...). Error message made consistent with str.replace().
---------- Added file: http://bugs.python.org/file40010/strop.replace_Integer_Overflow_2.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24708> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com