Whole file
alecthomas/voluptuous
The author described this change as “Fix vol.Remove not removing keys that do not validate (#515)”. It counts as a record because the check below fails on the code as it stood at 2232c0e55 and passes on ca4006a68, with nothing else changed between the two runs.
Projectalecthomas/voluptuous
Fix saved2024-06-23
Sharing licenceBSD-3-Clause · COPYING
Change size+3 −3
What the code was meant to do, written into the code itself as a save note
Fix vol.Remove not removing keys that do not validate (#515)
The change
| 435 | 435 | ||
| 436 | 436 | break | |
| 437 | 437 | else: | |
| 438 | - | if error: | |
| 439 | - | errors.append(error) | |
| 440 | - | elif remove_key: | |
| 438 | + | if remove_key: | |
| 441 | 439 | # remove key | |
| 442 | 440 | continue | |
| 441 | + | elif error: | |
| 442 | + | errors.append(error) | |
| 443 | 443 | elif self.extra == ALLOW_EXTRA: | |
| 444 | 444 | out[key] = value | |
| 445 | 445 | elif self.extra != REMOVE_EXTRA: |
The check that tells the two apart
fail→pass·voluptuous/tests/tests.py::test_remove_with_error
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 it2232c0e556bc68343388fa8499bdbf13196a7514
Broken version dated2024-06-23
Modulevoluptuous.schema_builder
Units changedSchema
Fingerprintd5a7018db652c48a
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
- 2026-07-11Number
- 2026-07-04Number
- 2025-04-30Fix bug with Any validator and REMOVE_EXTRA (#524)
- 2024-02-01fix: allow unsortable containers in In and NotIn validators (fixes #451) (#506)