Whole file
horejsek/python-fastjsonschema
The author described this change as “fix: don't leak variables from not blocks into the outer scope”. It counts as a record because the check below fails on the code as it stood at 8f5c02ec2 and passes on 10e952b40, with nothing else changed between the two runs.
Fix saved2026-07-20
Sharing licenceBSD-3-Clause · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a save note
fix: don't leak variables from not blocks into the outer scope
The change
| 256 | 256 | self.exc('{name} must NOT match a disallowed definition', rule='not') | |
| 257 | 257 | else: | |
| 258 | 258 | with self.l('try:', optimize=False): | |
| 259 | - | self.generate_func_code_block(not_definition, self._variable, self._variable_name) | |
| 259 | + | self.generate_func_code_block(not_definition, self._variable, self._variable_name, clear_variables=True) | |
| 260 | 260 | self.l('except JsonSchemaValueException: pass') | |
| 261 | 261 | with self.l('else:'): | |
| 262 | 262 | self.exc('{name} must NOT match a disallowed definition', rule='not') |
The check that tells the two apart
fail→pass·tests/test_common.py::test_not_with_object_and_additional_properties[value0-expected0]
Check file tests/test_common.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 it8f5c02ec20bdfc106bbe188305e54d837156ba2b
Broken version dated2026-05-23
Modulefastjsonschema.draft04
Units changedCodeGeneratorDraft04
Fingerprint90675c9ac5d972c4
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 horejsek/python-fastjsonschema
- 2022-07-17Fix false unique items
- 2020-08-17Fix missing dependenices
- 2019-09-26Fix of uniqueItems when used with other than array type