You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PyUnicode_FromFormat() is loose in checking for errors in the format string. If it encounter an invalid format specifier, it silently outputs the rest of the format string. And it allows digits between %s: "%123%" is interpreted the same as "%%", i.e. as literal %.
It was not a big problem, because it is expected that the user of the C API do not make mistakes in the format string, and incorrect format string can easily lead to crash. But id did not help either.
…ormatV()
SystemError is now raised if the format contains invalid format
specifiers. Previously it just silently output the rest of the format
string starting from the invalid specifier.
…ormatV()
An unrecognized format character in PyUnicode_FromFormat() and
PyUnicode_FromFormatV() now sets a SystemError.
In previous versions it caused all the rest of the format string to be
copied as-is to the result string, and any extra arguments discarded.
…() (GH-95784)
An unrecognized format character in PyUnicode_FromFormat() and
PyUnicode_FromFormatV() now sets a SystemError.
In previous versions it caused all the rest of the format string to be
copied as-is to the result string, and any extra arguments discarded.
…ormatV() (pythonGH-95784)
An unrecognized format character in PyUnicode_FromFormat() and
PyUnicode_FromFormatV() now sets a SystemError.
In previous versions it caused all the rest of the format string to be
copied as-is to the result string, and any extra arguments discarded.
PyUnicode_FromFormat()
is loose in checking for errors in the format string. If it encounter an invalid format specifier, it silently outputs the rest of the format string. And it allows digits between%
s:"%123%"
is interpreted the same as"%%"
, i.e. as literal%
.It was not a big problem, because it is expected that the user of the C API do not make mistakes in the format string, and incorrect format string can easily lead to crash. But id did not help either.
Recently it was discussed on Discuss: https://discuss.python.org/t/pyunicode-fromformat-allow-format-with-precision/17873.
The text was updated successfully, but these errors were encountered: