Commit c72953c
Fix IndexError in initials for unnormalized *_list elements
_process_initial split name parts with split(" "), which yields empty
strings for repeated spaces, and part[0] on an empty string raised
IndexError. The parse path never produces such parts because
parse_pieces normalizes whitespace, but first_list/middle_list/
last_list are plain attributes, so direct assignment bypasses that
normalization (e.g. name.middle_list = ['Q R']).
Use bare split(), which treats any whitespace run as one delimiter and
never yields empty strings — identical to split(" ") for normalized
input, and also tolerant of tabs, newlines, and leading/trailing
whitespace in directly-assigned elements.
Closes #232
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 7b4c5fe commit c72953c
3 files changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
254 | 257 | | |
255 | 258 | | |
256 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
137 | 146 | | |
138 | 147 | | |
139 | 148 | | |
| |||
0 commit comments