changeset: 98610:0a522f68d275 user: Victor Stinner date: Fri Oct 09 03:37:11 2015 +0200 files: Objects/unicodeobject.c description: Issue #25318: Fix backslashreplace() Fix code to estimate the needed space. diff -r 9cf89366bbcb -r 0a522f68d275 Objects/unicodeobject.c --- a/Objects/unicodeobject.c Fri Oct 09 03:17:30 2015 +0200 +++ b/Objects/unicodeobject.c Fri Oct 09 03:37:11 2015 +0200 @@ -590,7 +590,7 @@ incr = 2+4; else { assert(ch <= MAX_UNICODE); - incr = 2+6; + incr = 2+8; } if (size > PY_SSIZE_T_MAX - incr) { PyErr_SetString(PyExc_OverflowError,