Commit graph

3 commits

Author SHA1 Message Date
Miss Islington (bot)
f5119a536a
[3.15] gh-151845: Fix formatfloat() return-value contract in unicode_format.c (GH-151846) (#151865)
gh-151845: Fix formatfloat() return-value contract in unicode_format.c (GH-151846)

Fix formatfloat() return-value contract in unicode_format.c
(cherry picked from commit c2661e6189)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2026-06-21 17:43:01 +00:00
Serhiy Storchaka
012c498035
gh-142037: Improve error messages for printf-style formatting (GH-142081)
This affects string formatting as well as bytes and bytearray formatting.

* For errors in the format string, always include the position of the
  start of the format unit.
* For errors related to the formatted arguments, always include the number
  or the name of the formatted argument.
* Suggest more probable causes of errors in the format string (stray %,
  unsupported format, unexpected character).
* Provide more information when the number of arguments does not match
  the number of format units.
* Raise more specific errors when access of arguments by name is mixed with
  sequential access and when * is used with a mapping.
* Add tests for some uncovered cases.
2026-01-24 11:13:50 +00:00
Victor Stinner
4c119714d5
gh-139353: Add Objects/unicode_format.c file (#139491)
* Move PyUnicode_Format() implementation from unicodeobject.c
  to unicode_format.c.
* Replace unicode_modifiable() with _PyUnicode_IsModifiable()
* Add empty lines to have two empty lines between functions.
2025-10-10 12:52:59 +02:00