One function
ParsedException in mahmoud/boltons
The author described this change as “fix(tbutils): avoid IndexError in ParsedException.from_string on truncated tracebacks”. It counts as a record because the check below fails on the code as it stood at 80f9eb429 and passes on 8a2a93d82, with nothing else changed between the two runs.
Projectmahmoud/boltons
Fix saved2026-06-17
Sharing licenceBSD-2-Clause · LICENSE
Change size+5 −4
What the code was meant to do, written into the code itself as a docstring
Stores a parsed traceback and exception as would be typically output by :func:`sys.excepthook` or :func:`traceback.print_exception`. .. note: Does not currently store SyntaxError details such as column.
The change
| 105 | 105 | ||
| 106 | 106 | frames = [] | |
| 107 | 107 | line_no = start_line | |
| 108 | - | while True: | |
| 108 | + | while line_no < len(tb_lines): | |
| 109 | 109 | frame_line = tb_lines[line_no].strip() | |
| 110 | 110 | frame_match = frame_re.match(frame_line) | |
| 111 | 111 | if frame_match: | |
| ⋯ | |||
| 128 | 128 | else: | |
| 129 | 129 | frame_dict['source_line'] = next_line_stripped | |
| 130 | 130 | line_no += 1 | |
| 131 | - | if _underline_re.match(tb_lines[line_no + 1]): | |
| 132 | - | # To deal with anchors | |
| 133 | - | line_no += 1 | |
| 131 | + | if (line_no + 1 < len(tb_lines) | |
| 132 | + | and _underline_re.match(tb_lines[line_no + 1])): | |
| 133 | + | # To deal with anchors | |
| 134 | + | line_no += 1 | |
| 134 | 135 | else: | |
| 135 | 136 | break | |
| 136 | 137 | line_no += 1 | |
The check that tells the two apart
fail→pass·tests/test_tbutils_parsed_exc.py::test_parsed_exc_truncated
Check file tests/test_tbutils_parsed_exc.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 it80f9eb4296daadad85db5ef6c0fd14e2f3602fa4
Broken version dated2026-06-17
Moduleboltons.tbutils
Units changedParsedException
Fingerprint1d74283a2593e7f5
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 mahmoud/boltons
- 2026-08-06Bits
- 2026-08-06JSONLIterator
- 2026-08-06tableutils: fix Table.to_text crashes on degenerate tables and headers
- 2026-07-18backoff_iter
- 2026-07-17singularize
- 2026-07-17fix(fileutils): accept os.PathLike in AtomicSaver