Whole file

alecthomas/voluptuous

The author described this change as Fix bug with Any validator and REMOVE_EXTRA (#524). It counts as a record because the check below fails on the code as it stood at a7a55f83b and passes on 4a9c8f8ef, with nothing else changed between the two runs.

Fix saved2025-04-30
Sharing licenceBSD-3-Clause · COPYING
Change size+4 2

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

Fix bug with Any validator and REMOVE_EXTRA (#524)

The change

364364 continue
365365 elif self.extra == ALLOW_EXTRA:
366366 out[key] = value
367+ elif self.extra == REMOVE_EXTRA:
368+ # ignore the key so it's removed from output
369+ continue
367370 elif error:
368371 errors.append(error)
369- elif self.extra != REMOVE_EXTRA:
372+ else:
370373 errors.append(er.Invalid('extra keys not allowed', key_path))
371- # else REMOVE_EXTRA: ignore the key so it's removed from output
372374
373375 # for any required keys left that weren't found and don't have defaults:
374376 for key in required_keys:

The check that tells the two apart

failpass·voluptuous/tests/tests.py::test_any_with_extra_remove

Check file voluptuous/tests/tests.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 ita7a55f83b9fa7ba68b0669b3d78a61de703e0a16
Broken version dated2024-07-22
Modulevoluptuous.schema_builder
Units changedSchema
Fingerprint0c53d23bd8e3ff7e
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 alecthomas/voluptuous