Whole file
keleshev/schema
The author described this change as “Fix TypeError when building the key error message for a tuple key”. It counts as a record because the check below fails on the code as it stood at 340d3f059 and passes on d81871b86, with nothing else changed between the two runs.
Projectkeleshev/schema
Fix saved2026-06-13
Sharing licenceMIT · LICENSE-MIT
Change size+1 −1
What the code was meant to do, written into the code itself as a save note
Fix TypeError when building the key error message for a tuple key
The change
| 494 | 494 | svalue, error=e, ignore_extra_keys=i | |
| 495 | 495 | ).validate(value, **kwargs) | |
| 496 | 496 | except SchemaError as x: | |
| 497 | - | k = "Key '%s' error:" % nkey | |
| 497 | + | k = "Key '%s' error:" % (nkey,) | |
| 498 | 498 | message = self._prepend_schema_name(k) | |
| 499 | 499 | raise SchemaError( | |
| 500 | 500 | [message] + x.autos, |
The check that tells the two apart
fail→pass·test_schema.py::test_tuple_key_error_message_does_not_crash
Check file test_schema.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 it340d3f0596b985db9e7c81a1233f784648d7c101
Broken version dated2026-03-04
Moduleschema.__init__
Units changedSchema
Fingerprinta4789c2c52dc66a0
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 keleshev/schema
- 2026-06-15Fix custom error on a key schema being lost for wrong keys
- 2025-02-27fix: JSON Schema missing title in subschemas
- 2017-01-17fix: Schema can be inherited (#127)
- 2016-02-16add strict flag in Schema class to skip wrong key validation without wildcard
- 2015-09-26Fix reliance on `__name__` of callables
- 2014-02-03Handle wrong keys better. Fixes #3 and #15