Whole file

keleshev/schema

The author described this change as Handle wrong keys better. Fixes #3 and #15. It counts as a record because the check below fails on the code as it stood at a07cafd27 and passes on 2af1f4e08, with nothing else changed between the two runs.

Fix saved2014-02-03
Sharing licenceMIT · LICENSE-MIT
Change size+1 3

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

Handle wrong keys better. Fixes #3 and #15

The change

134134 new[nkey] = nvalue
135135 elif skey is not None:
136136 if x is not None:
137- raise SchemaError(['key %r is required' % key] +
137+ raise SchemaError(['invalid value for key %r' % key] +
138138 x.autos, [e] + x.errors)
139- else:
140- raise SchemaError('key %r is required' % skey, e)
141139 coverage = set(k for k in coverage if type(k) is not Optional)
142140 required = set(k for k in s if type(k) is not Optional)
143141 if coverage != required:

The check that tells the two apart

failpass·test_schema.py::test_dict

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 ita07cafd27fd84cd0a007ce0960f39508c866a011
Broken version dated2014-02-03
Moduleschema
Units changedSchema
Fingerprint6506612b53a82d21
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