[issue10254] unicodedata.normalize('NFC', s) regression

Alexander Belopolsky report at bugs.python.org
Thu Dec 16 20:35:40 CET 2010


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

Adding an assert as shown in the diff below, makes it easy to reproduce the crash in py3k branch:

$ ./python.exe  crash.py
Assertion failed: (cskipped < 20), function nfc_nfkc, file Modules/unicodedata.c, line 714.
Abort trap

I am attaching jhalcrow's code as crash.py 

===================================================================
--- Modules/unicodedata.c	(revision 87322)
+++ Modules/unicodedata.c	(working copy)
@@ -711,6 +711,7 @@
           /* Replace the original character. */
           *i = code;
           /* Mark the second character unused. */
+          assert(cskipped < 20);
           skipped[cskipped++] = i1;
           i1++;
           f = find_nfc_index(self, nfc_first, *i);

----------
nosy: +belopolsky
Added file: http://bugs.python.org/file20080/crash.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10254>
_______________________________________


More information about the Python-bugs-list mailing list