One function
parse in kellyjonbrazil/jc
The author described this change as “fix for unhandled lines in xrandr output”. It counts as a record because the check below fails on the code as it stood at 3ca8e1ef1 and passes on 1da080dc5, with nothing else changed between the two runs.
Projectkellyjonbrazil/jc
Fix saved2024-03-23
Sharing licenceMIT · LICENSE.md
Change size+10 −0
What the code was meant to do, written into the code itself as a docstring
Main text parsing function Parameters: data: (string) text data to parse raw: (boolean) unprocessed output if True quiet: (boolean) suppress warning messages if True Returns: Dictionary. Raw or processed structured data.
The change
| 19 | 19 | lines = data.splitlines() | |
| 20 | 20 | screen, device = None, None | |
| 21 | 21 | ||
| 22 | + | # temporary fix to ignore specific unhandled lines | |
| 23 | + | ignore_pattern = re.compile(r'^\s+(h|v):\s+(height|width)\s+\d+\s+start\s+\d+\s+end') | |
| 24 | + | ||
| 22 | 25 | result: Response = {"screens": []} | |
| 23 | 26 | if jc.utils.has_data(data): | |
| 24 | 27 | while index < len(lines): | |
| 28 | + | ||
| 29 | + | # temporary fix to ignore specific unhandled lines | |
| 30 | + | ignore_re = ignore_pattern.match(lines[index]) | |
| 31 | + | if ignore_re: | |
| 32 | + | index += 1 | |
| 33 | + | continue | |
| 34 | + | ||
| 25 | 35 | line = _Line.categorize(lines[index]) | |
| 26 | 36 | if line.t == LineType.Screen: | |
| 27 | 37 | screen = _parse_screen(line) |
The check that tells the two apart
fail→pass·tests/test_xrandr.py::XrandrTests::test_issue_549
Check file tests/test_xrandr.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 it3ca8e1ef11bc011e726009f3e7db82869fbbd6b1
Broken version dated2024-03-19
Modulejc.parsers.xrandr
Units changedparse
Fingerprint6127505f459637bb
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
- 2026-03-25_process
- 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)