One function
_format in astanin/python-tabulate
The author described this change as “fix #176 - implement Decimal fixed-point support”. It counts as a record because the check below fails on the code as it stood at 8f3208666 and passes on 5373ebfa9, with nothing else changed between the two runs.
Projectastanin/python-tabulate
Fix saved2026-03-05
Sharing licenceMIT · LICENSE
Change size+2 −0
What the code was meant to do, written into the code itself as a docstring
Format a value according to its deduced type. Empty values are deemed valid for any type. Unicode is supported:
The change
| 47 | 47 | else: | |
| 48 | 48 | if isinstance(val, str) and "," in val: | |
| 49 | 49 | val = val.replace(",", "") # handle thousands-separators | |
| 50 | + | if isinstance(val, Decimal): | |
| 51 | + | return format(val, floatfmt) | |
| 50 | 52 | try: | |
| 51 | 53 | return format(float(val), floatfmt) | |
| 52 | 54 | except (ValueError, TypeError): |
The check that tells the two apart
fail→pass·test/test_output.py::test_floatfmt_decimal
Check file test/test_output.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it8f32086665760bcb2bd729623dc58a8da259a68b
Broken version dated2026-03-05
Moduletabulate.__init__
Units changed_format
Fingerprint511bc4cdf1a66a5d
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in astanin/python-tabulate
- 2026-03-05_asciidoc_row
- 2023-07-20_format_table
- 2014-02-12_normalize_tabular_data
- 2013-11-20simple_separated_format
- 2013-08-09_normalize_tabular_data