Repository navigation
Commit 5b556a0
Correct error messages for out-of-range Meta length bounds (msgspec#1172)
Calling `Meta(min_length=10**400)` results in a `ValueError` with the
incorrect message "must be >= 0" for a positive integer. With this fix,
out-of-range `min_length` and `max_length` values result in an error
identifying the range issue. Accepted values and diagnostics for
representable negative values are unchanged.
This is the length-bound fix discussed in msgspec#1122, separate from the
numeric constraints work in msgspec#1006.
Co-authored-by: Александр Сергеевич Целуйко <[email protected]>1 parent 2e2c863 commit 5b556a0
2 files changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1726 | 1726 | | |
1727 | 1727 | | |
1728 | 1728 | | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
1729 | 1740 | | |
1730 | 1741 | | |
1731 | 1742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| 172 | + | |
171 | 173 | | |
172 | 174 | | |
173 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
174 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
175 | 193 | | |
176 | 194 | | |
177 | 195 | | |
| |||
0 commit comments