diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-21 13:31:41 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-21 13:31:41 (GMT) |
commit | da29cc36aa2c7dcc3932ea1d83e261aa940ccdb4 (patch) | |
tree | 25809c9e42e05177422ea007fa2da3d0cf46a152 /Objects | |
parent | a996f1e1a05c96e449aabb7fa77e5128417ce7e0 (diff) | |
download | cpython-da29cc36aa2c7dcc3932ea1d83e261aa940ccdb4.zip cpython-da29cc36aa2c7dcc3932ea1d83e261aa940ccdb4.tar.gz cpython-da29cc36aa2c7dcc3932ea1d83e261aa940ccdb4.tar.bz2 |
Issue #13441: _PyUnicode_CheckConsistency() dumps the string if the maximum
character is bigger than U+10FFFF and locale.localeconv() dumps the string
before decoding it.
Temporary hack to debug the issue #13441.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 6798ef8..6307a98 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -391,6 +391,19 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content) if (ch > maxchar) maxchar = ch; } + if (maxchar > 0x10FFFF) { + printf("Invalid Unicode string! {"); + for (i=0; i < ascii->length; i++) + { + Py_UCS4 ch = PyUnicode_READ(kind, data, i); + if (i) + printf(", U+%04x", ch); + else + printf("U+%04x", ch); + } + printf("} (len=%u)\n", ascii->length); + abort(); + } if (kind == PyUnicode_1BYTE_KIND) { if (ascii->state.ascii == 0) { assert(maxchar >= 128); |