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.
Projectionelmc/python-tblib
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
| 119 | 119 | ||
| 120 | 120 | # noinspection PyBroadException | |
| 121 | 121 | try: | |
| 122 | - | exec(code, current.tb_frame.f_globals, {}) | |
| 122 | + | exec(code, dict(current.tb_frame.f_globals), {}) | |
| 123 | 123 | except Exception: | |
| 124 | 124 | next_tb = sys.exc_info()[2].tb_next | |
| 125 | 125 | if top_tb is None: |
The check that tells the two apart
fail→pass·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.