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.

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

999999 self._group_index += 1
10001000 self._type_conversions[group] = percentage
10011001 elif type == 'f':
1002- s = r'\d+\.\d+'
1002+ s = r'\d*\.\d+'
10031003 self._type_conversions[group] = lambda s, m: float(s)
10041004 elif type == 'F':
1005- s = r'\d+\.\d+'
1005+ s = r'\d*\.\d+'
10061006 self._type_conversions[group] = lambda s, m: Decimal(s)
10071007 elif type == 'e':
10081008 s = r'\d*\.\d+[eE][-+]?\d+|nan|NAN|[-+]?inf|[-+]?INF'

The check that tells the two apart

failpass·test_parse.py::TestParse::test_numbers
failpass·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