Message128961
Hi, haypo, Your patch seems cannot be applied cleanly on current py3k trunk. And after modified your patch, test_unicode.py runs into Segmentation fault. Is there something wrong or some changes which could influence this bug had been already made since the patch is worked out?
On the current trunk, I guess the bug could be fixed in a simpler way:
In step 1, before check '%%', check '%'(a string ends with '%') first. Then check '%%' and skip it.
The whole patch:
Index: Objects/unicodeobject.c
===================================================================
--- Objects/unicodeobject.c (revision 88453)
+++ Objects/unicodeobject.c (working copy)
@@ -750,8 +750,12 @@
* result in an array) */
for (f = format; *f; f++) {
if (*f == '%') {
- if (*(f+1)=='%')
+ if (*(f+1)=='\0')
+ continue;
+ if (*(f+1)=='%') {
+ f++;
continue;
+ }
if (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A')
++callcount;
while (Py_ISDIGIT((unsigned)*f))
After applying this small patch and tests in your patch, test_unicode.py can passed. |
|
Date |
User |
Action |
Args |
2011-02-21 13:30:40 | ysj.ray | set | recipients:
+ ysj.ray, amaury.forgeotdarc, vstinner |
2011-02-21 13:30:40 | ysj.ray | set | messageid: <1298295040.2.0.697396816015.issue10829@psf.upfronthosting.co.za> |
2011-02-21 13:30:39 | ysj.ray | link | issue10829 messages |
2011-02-21 13:30:39 | ysj.ray | create | |
|