[issue2242] Decoding UTF-7 with "ignore warnings" crashes Python on Windows Vista

Hirokazu Yamamoto report at bugs.python.org
Thu Mar 6 08:34:14 CET 2008


Hirokazu Yamamoto added the comment:

I reproduced this bug with VC6 + Win2000SP4 + following code.

'+\xc1'.decode("utf7", "ignore")

and this simple patch prevented crash.

Index: Objects/unicodeobject.c
===================================================================
--- Objects/unicodeobject.c	(revision 61262)
+++ Objects/unicodeobject.c	(working copy)
@@ -1506,7 +1506,7 @@
     e = s + size;
 
     while (s < e) {
-        Py_UNICODE ch;
+        char ch;
         restart:
         ch = *s;

Probably this is due to integer conversion, but I didn't look at logic
so much.

----------
nosy: +ocean-city

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2242>
__________________________________


More information about the Python-bugs-list mailing list