[3.11] gh-114563: C decimal falls back to pydecimal for unsupported format strings (GH-114879) (GH-115384)

Immediate merits:
* eliminate complex workarounds for 'z' format support
  (NOTE: mpdecimal recently added 'z' support, so this becomes
  efficient in the long term.)
* fix 'z' format memory leak
* fix 'z' format applied to 'F'
* fix missing 'GH-' format support

Suggested and prototyped by Stefan Krah.

Fixes gh-114563, gh-91060

(cherry picked from commit 72340d15cd)
(cherry picked from commit 09c98e4633)

Co-authored-by: Stefan Krah <skrah@bytereef.org>
This commit is contained in:
John Belmonte 2024-02-13 17:38:06 +09:00 committed by GitHub
parent d87a02223c
commit b86fdf2222
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 87 additions and 122 deletions

View file

@ -1273,6 +1273,7 @@ Modules/_decimal/_decimal.c - basic_context_template -
Modules/_decimal/_decimal.c - current_context_var -
Modules/_decimal/_decimal.c - default_context_template -
Modules/_decimal/_decimal.c - extended_context_template -
Modules/_decimal/_decimal.c - PyDecimal -
Modules/_decimal/_decimal.c - round_map -
Modules/_decimal/_decimal.c - Rational -
Modules/_decimal/_decimal.c - SignalTuple -

Can't render this file because it has a wrong number of fields in line 4.