Victor Stinner wrote:
> Le jeudi 24 mars 2011 à 13:22 +0100, M.-A. Lemburg a écrit :
>> BTW: Why do you think that %.100s is not supported in
>> PyErr_Format() in Python 2.x ? PyString_FromFormatV()
>> does support this. The change to use Unicode error strings
>> introduced the problem, since PyUni
Le jeudi 24 mars 2011 à 13:22 +0100, M.-A. Lemburg a écrit :
> BTW: Why do you think that %.100s is not supported in
> PyErr_Format() in Python 2.x ? PyString_FromFormatV()
> does support this. The change to use Unicode error strings
> introduced the problem, since PyUnicode_FromFormatV() for
> som
> I would like to replace %.100s because there are no more reason to
> truncate strings to an arbitrary length.
I agree with MAL. It protects against cases with ridiculously long
parameters - say, you have a string with 1GB. You *want* to truncate
bogus text.
Regards,
Martin
_
Victor Stinner wrote:
> Hi,
>
> I plan to replace all %.100s (or any other size, %\.[0-9]+s regex) by %s
> in the whole source code, in all calls to PyErr_Format(). And I would
> like your opinion.
>
> When Guido added the function PyErr_Format(), 13 years ago, the function
> was implemented usin
Hi,
I plan to replace all %.100s (or any other size, %\.[0-9]+s regex) by %s
in the whole source code, in all calls to PyErr_Format(). And I would
like your opinion.
When Guido added the function PyErr_Format(), 13 years ago, the function
was implemented using a buffer of 500 bytes (allocated on