Commit 8412d3f
committed
fix: raise instead of silently corrupting output on an unresolvable delimiter sentinel
nickname_delimiters/maiden_delimiters string values that don't resolve
to a real Constants.regexes key used to fall back to RegexTupleManager's
EMPTY_REGEX default. That's not a harmless no-op: EMPTY_REGEX matches
at every character position, so handle_match() fired repeatedly and
appended '' into the bucket's list each time, producing a truthy
whitespace-only nickname/maiden while leaving the intended delimiter's
content (e.g. literal parentheses) unstripped elsewhere in the name.
Found independently by two review agents with working reproductions
while auditing PR #199. Now raises ValueError naming the bad key
instead. To keep Constants(regexes=<minimal custom set>) working
(confirmed via the existing test_override_regex), nickname_delimiters
is only seeded with a built-in name if it's actually present in the
regexes passed to the constructor -- so a caller who deliberately
drops e.g. "parenthesis" from a custom regexes set doesn't end up with
a dangling sentinel that looks like a mistake.1 parent cddb09f commit 8412d3f
3 files changed
Lines changed: 53 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
488 | 493 | | |
489 | | - | |
490 | | - | |
491 | | - | |
| 494 | + | |
| 495 | + | |
492 | 496 | | |
493 | 497 | | |
494 | 498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
925 | | - | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
926 | 936 | | |
927 | 937 | | |
928 | 938 | | |
929 | 939 | | |
930 | 940 | | |
931 | 941 | | |
932 | 942 | | |
933 | | - | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
934 | 952 | | |
935 | 953 | | |
936 | 954 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
0 commit comments