Whole file
r1chardj0n3s/parse
The author described this change as “Handle fortran formatted float number, Bug fix & test case.”. It counts as a record because the checks below fail on the code as it stood at 295b47d70 and pass on 38d21c015, with nothing else changed between the two runs.
Projectr1chardj0n3s/parse
Fix saved2019-12-23
Sharing licenceMIT · LICENSE
Change size+2 −2
What the code was meant to do, written into the code itself as a save note
Handle fortran formatted float number, Bug fix & test case.
The change
| 999 | 999 | self._group_index += 1 | |
| 1000 | 1000 | self._type_conversions[group] = percentage | |
| 1001 | 1001 | elif type == 'f': | |
| 1002 | - | s = r'\d+\.\d+' | |
| 1002 | + | s = r'\d*\.\d+' | |
| 1003 | 1003 | self._type_conversions[group] = lambda s, m: float(s) | |
| 1004 | 1004 | elif type == 'F': | |
| 1005 | - | s = r'\d+\.\d+' | |
| 1005 | + | s = r'\d*\.\d+' | |
| 1006 | 1006 | self._type_conversions[group] = lambda s, m: Decimal(s) | |
| 1007 | 1007 | elif type == 'e': | |
| 1008 | 1008 | s = r'\d*\.\d+[eE][-+]?\d+|nan|NAN|[-+]?inf|[-+]?INF' |
The check that tells the two apart
fail→pass·test_parse.py::TestParse::test_numbers
fail→pass·test_parse.py::TestParse::test_precision
Check file test_parse.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 it295b47d7077c7a5597ac5e1ecfcddc13e7c9b27a
Broken version dated2019-12-23
Moduleparse
Units changedParser
Fingerprint71e73461b8fe1020
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 r1chardj0n3s/parse
- 2021-06-04Fix handling of unused alignment (#132)
- 2020-07-30findall
- 2013-10-15date_convert
- 2012-09-29fix type conversion error with dotted names