Commit 9c2e30d
committed
gh-153392: Raise TOMLDecodeError for over-long integers in tomllib
The number branch of tomllib's value parser called match_to_number
without wrapping ValueError, so an integer with more digits than the
interpreter's integer string conversion limit escaped as a bare
ValueError. The date and time branch already wraps ValueError into
TOMLDecodeError; do the same for the number branch so tomllib only
raises TOMLDecodeError on a malformed document.1 parent e933987 commit 9c2e30d
3 files changed
Lines changed: 18 additions & 1 deletion
File tree
- Lib
- test/test_tomllib
- tomllib
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
37 | 47 | | |
38 | 48 | | |
39 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
741 | | - | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
742 | 746 | | |
743 | 747 | | |
744 | 748 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments