One function
_process in kellyjonbrazil/jc
The author described this change as “Fix ifconfig hex mask conversion using lstrip('0x') instead of [2:]”. It counts as a record because the check below fails on the code as it stood at 585ff83a2 and passes on 2f9377cb6, with nothing else changed between the two runs.
Projectkellyjonbrazil/jc
Fix saved2026-03-25
Sharing licenceMIT · LICENSE.md
Change size+2 −2
What the code was meant to do, written into the code itself as a docstring
Final processing to conform to the schema. Parameters: proc_data: (List of Dictionaries) raw structured data to process Returns: List of Dictionaries. Structured to conform to the schema.
The change
| 27 | 27 | try: | |
| 28 | 28 | if entry['ipv4_mask'].startswith('0x'): | |
| 29 | 29 | new_mask = entry['ipv4_mask'] | |
| 30 | - | new_mask = new_mask.lstrip('0x') | |
| 30 | + | new_mask = new_mask[2:] | |
| 31 | 31 | new_mask = '.'.join(str(int(i, 16)) for i in [new_mask[i:i + 2] for i in range(0, len(new_mask), 2)]) | |
| 32 | 32 | entry['ipv4_mask'] = new_mask | |
| 33 | 33 | except (ValueError, TypeError, AttributeError): | |
| ⋯ | |||
| 52 | 52 | try: | |
| 53 | 53 | if ip_address['mask'].startswith('0x'): | |
| 54 | 54 | new_mask = ip_address['mask'] | |
| 55 | - | new_mask = new_mask.lstrip('0x') | |
| 55 | + | new_mask = new_mask[2:] | |
| 56 | 56 | new_mask = '.'.join(str(int(i, 16)) for i in [new_mask[i:i + 2] for i in range(0, len(new_mask), 2)]) | |
| 57 | 57 | ip_address['mask'] = new_mask | |
| 58 | 58 | except (ValueError, TypeError, AttributeError): | |
The check that tells the two apart
fail→pass·tests/test_ifconfig.py::MyTests::test_ifconfig_hex_mask_all_zeros
Check file tests/test_ifconfig.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 it585ff83a2e97f58427df10a04f699603ebc065a0
Broken version dated2026-03-16
Modulejc.parsers.ifconfig
Units changed_process
Fingerprint341f264a0cdd152f
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 kellyjonbrazil/jc
- 2026-03-25parse
- 2025-04-02Fix broken controller parser schema to include power state prop (#652)
- 2025-03-31parse
- 2025-03-31fix time parser for missing centiseconds
- 2024-10-18Fix broken controller regexp scheme in the bluetoothctl parser (#599)
- 2024-09-07fix uptime for "user" instead of "users"