[Python-checkins] cpython: Issue #25318: Fix backslashreplace()

victor.stinner python-checkins at python.org
Thu Oct 8 21:38:56 EDT 2015


https://hg.python.org/cpython/rev/0a522f68d275
changeset: 98610:0a522f68d275
user: Victor Stinner <victor.stinner at gmail.com>
date: Fri Oct 09 03:37:11 2015 +0200
summary:
 Issue #25318: Fix backslashreplace()
Fix code to estimate the needed space.
files:
 Objects/unicodeobject.c | 2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -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,
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /