One function
singularize in mahmoud/boltons
The author described this change as “fix(strutils): stop singularize() mangling words ending in 'ss'”. It counts as a record because the check below fails on the code as it stood at 55dfe5077 and passes on 1e61524a7, with nothing else changed between the two runs.
Projectmahmoud/boltons
Fix saved2026-07-17
Sharing licenceBSD-2-Clause · LICENSE
Change size+7 −0
What the code was meant to do, written into the code itself as a docstring
Semi-intelligently converts an English plural *word* to its singular form, preserving case pattern.
The change
| 27 | 27 | singular = word[:-3] + 'y' | |
| 28 | 28 | elif word.endswith('es') and word[-3] == 's': | |
| 29 | 29 | singular = word[:-2] | |
| 30 | + | elif word.endswith('ss'): | |
| 31 | + | # Words ending in a double 's' (glass, boss, kiss) are already | |
| 32 | + | # singular; their plurals end in 'sses' and are handled above. Do | |
| 33 | + | # not blindly strip the trailing 's', which would produce 'glas', | |
| 34 | + | # 'bos', 'kis' and break idempotency (singularize('Glasses') == | |
| 35 | + | # 'Glass', but 'Glass' must stay 'Glass'). | |
| 36 | + | return orig_word | |
| 30 | 37 | else: | |
| 31 | 38 | singular = word[:-1] | |
| 32 | 39 | return _match_case(orig_word, singular) |
The check that tells the two apart
fail→pass·tests/test_strutils.py::test_singularize_double_s
Check file tests/test_strutils.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 it55dfe5077bcb5fa76611b5f2a557ea6c442ad87c
Broken version dated2026-07-17
Moduleboltons.strutils
Units changedsingularize
Fingerprint3c6ac80dd630cd20
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 mahmoud/boltons
- 2026-08-06Bits
- 2026-08-06JSONLIterator
- 2026-08-06tableutils: fix Table.to_text crashes on degenerate tables and headers
- 2026-07-18backoff_iter
- 2026-07-17fix(fileutils): accept os.PathLike in AtomicSaver
- 2026-07-17Fix copy.copy/copy.deepcopy collapsing OrderedMultiDict values