This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ysj.ray
Recipients amaury.forgeotdarc, vstinner, ysj.ray
Date 2011-02-21.13:30:39
SpamBayes Score 3.6474657e-11
Marked as misclassified No
Message-id <1298295040.2.0.697396816015.issue10829@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-02-21 13:30:40ysj.raysetrecipients: + ysj.ray, amaury.forgeotdarc, vstinner
2011-02-21 13:30:40ysj.raysetmessageid: <1298295040.2.0.697396816015.issue10829@psf.upfronthosting.co.za>
2011-02-21 13:30:39ysj.raylinkissue10829 messages
2011-02-21 13:30:39ysj.raycreate