Whole file

ionelmc/python-tblib

The author described this change as Prevent as_traceback mutating the object (turns out exec will add builtins to the globals). Add some tests that illustrate the bug.. It counts as a record because the check below fails on the code as it stood at 84af30f33 and passes on f9c2a0df1, with nothing else changed between the two runs.

Fix saved2020-03-08
Sharing licenceBSD-2-Clause · LICENSE
Change size+1 1

What the code was meant to do, written into the code itself as a save note

Prevent as_traceback mutating the object (turns out exec will add builtins to the globals). Add some tests that illustrate the bug.

The change

119119
120120 # noinspection PyBroadException
121121 try:
122- exec(code, current.tb_frame.f_globals, {})
122+ exec(code, dict(current.tb_frame.f_globals), {})
123123 except Exception:
124124 next_tb = sys.exc_info()[2].tb_next
125125 if top_tb is None:

The check that tells the two apart

failpass·tests/test_tblib.py::test_parse_traceback

Check file tests/test_tblib.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 it84af30f33664c2962512c58ea72314d7e667a99b
Broken version dated2020-03-08
Moduletblib.__init__
Units changedTraceback
Fingerprint1308a309ebda8299
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.