[issue7330] PyUnicode_FromFormat segfault

Ray.Allen report at bugs.python.org
Thu Mar 3 10:27:36 CET 2011


Ray.Allen <ysj.ray at gmail.com> added the comment:

Here is the updated patch:

1, Work with function parse_format_flags() which is introduced in issue10829, and the patch is simpler and more clear than before.
2, Change parse_format_flags() to set precision value to -1 in the case of '%s' in order to differ with '%.0s'
3, Move call of unicode_format_align() in step 3 in order to avoid many codes like "n += width > PyUnicode_GET_SIZE(str) ? width : PyUnicode_GET_SIZE(str);", (following haypo's comments)

----------
Added file: http://bugs.python.org/file20983/issue7330_2.diff

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


More information about the Python-bugs-list mailing list