[issue10829] PyUnicode_FromFormatV() bugs with "%" and "%%" format strings

2011-03-03 Thread STINNER Victor
STINNER Victor added the comment: > Hi, haypo, would you mind modify your newly added parse_format_flags() > function so that it can diff the precision value of '%.0s' and > '%s'(Currently both of them return precision as 0)? You should update your patch attached to #7330. I hope that your patc

[issue10829] PyUnicode_FromFormatV() bugs with "%" and "%%" format strings

2011-03-02 Thread Ray.Allen
Ray.Allen added the comment: Hi, haypo, would you mind modify your newly added parse_format_flags() function so that it can diff the precision value of '%.0s' and '%s'(Currently both of them return precision as 0)? Because if used with string formatters(%s, %R, %S, %A, ...), they should be ve

[issue10829] PyUnicode_FromFormatV() bugs with "%" and "%%" format strings

2011-03-01 Thread STINNER Victor
STINNER Victor added the comment: Fixed in Python 3.3 (r88702+r88703). I don't really want to backport it to 3.2, 3.1 or 2.7, because the patch is complex, changes a very important function, and the fixed bug (don't crash on invalid format strings) is minor. If you would like the fix into in

[issue10829] PyUnicode_FromFormatV() bugs with "%" and "%%" format strings

2011-02-21 Thread Ray.Allen
Ray.Allen added the comment: > Well, the main problem is that there are 3 different codes to parse the > format string, and each code is different... Attached patch factorizes the > code: create one subfunction parse_format_flags(). It fixes also this issue > and prepares the work to fix #108

[issue10829] PyUnicode_FromFormatV() bugs with "%" and "%%" format strings

2011-02-21 Thread STINNER Victor
STINNER Victor added the comment: Well, the main problem is that there are 3 different codes to parse the format string, and each code is different... Attached patch factorizes the code: create one subfunction parse_format_flags(). It fixes also this issue and prepares the work to fix #10831.

[issue10829] PyUnicode_FromFormatV() bugs with "%" and "%%" format strings

2011-02-21 Thread Ray.Allen
Changes by Ray.Allen : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue10829] PyUnicode_FromFormatV() bugs with "%" and "%%" format strings

2011-02-21 Thread Ray.Allen
Ray.Allen added the comment: 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

[issue10829] PyUnicode_FromFormatV() bugs with "%" and "%%" format strings

2011-01-07 Thread STINNER Victor
STINNER Victor added the comment: > PyBytes_FromFormatV() has the same issue. Oh no, it's ok, the function works as expected. -- ___ Python tracker ___

[issue10829] PyUnicode_FromFormatV() bugs with "%" and "%%" format strings

2011-01-04 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file20262/pyunicode_fromformatv.patch ___ Python tracker ___ ___ Python-bugs-

[issue10829] PyUnicode_FromFormatV() bugs with "%" and "%%" format strings

2011-01-04 Thread STINNER Victor
STINNER Victor added the comment: PyBytes_FromFormatV() has the same issue. -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue10829] PyUnicode_FromFormatV() bugs with "%" and "%%" format strings

2011-01-04 Thread STINNER Victor
STINNER Victor added the comment: Oh, my first patch was wrong: it failed on %c format (in zipimport with "%U%c%U"). The second version of the patch should be better. -- Added file: http://bugs.python.org/file20264/pyunicode_fromformatv-2.patch ___

[issue10829] PyUnicode_FromFormatV() bugs with "%" and "%%" format strings

2011-01-04 Thread STINNER Victor
New submission from STINNER Victor : Steps 1 and 3 of PyUnicode_FromFormatV() doesn't handle the format string "%%" correctly. The loop responsible to skip the precision moves outside the format string, and the function will then read uninitialized memory. The loop: while (*++f &&