[issue16153] PyUnicode_FromFormatV() must fail if the format string is invalid

2013-04-09 Thread STINNER Victor
STINNER Victor added the comment: Barry wrote on python-dev mailing list: "If it's documented to behave that way, why would you still consider it a bug? The current behavior is clearly intentional, the function is working as intended, and there may be code out there that depends on this documente

[issue16153] PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-07 Thread STINNER Victor
STINNER Victor added the comment: Updated patch: detect also invalid "%.s" format and update the documentation. > I don't know the reason for the previous behavior, but it's documented: Oh, I missed the doc. Fixed in the new patch. -- Added file: http://bugs.python.org/file27480/invali

[issue16153] PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-07 Thread Stefan Krah
Stefan Krah added the comment: I don't know the reason for the previous behavior, but it's documented: http://docs.python.org/dev/c-api/unicode.html?highlight=pyunicode_fromformatv#PyUnicode_FromFormat "An unrecognized format character causes all the rest of the format string to be copied as-

[issue16153] PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-06 Thread STINNER Victor
STINNER Victor added the comment: Hum, my patch is incomplete: "%.s" is not seen as an invalid format. -- ___ Python tracker ___ ___ P

[issue16153] PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-06 Thread STINNER Victor
STINNER Victor added the comment: The full test suite pass with the patch, so hopefully, CPython doesn't rely on this bug :-) -- ___ Python tracker ___ _

[issue16153] PyUnicode_FromFormatV() must fail if the format string is invalid

2012-10-06 Thread STINNER Victor
New submission from STINNER Victor: If the format string is invalid, PyUnicode_FromFormatV() formats the valid arguments and then copies the raw format string. Errors are silently ignored. I propose to raise a ValueError if the format string is invalid. This change may "break" existing applica