Commit 54ecfa5
committed
gh-152157: Reject empty fraction before timezone in C fromisoformat
The C accelerator for datetime.fromisoformat() and time.fromisoformat()
accepted a decimal separator (. or ,) with no following digit when a
timezone designator came next, e.g. '12:34:56.+05:00', while the
pure-Python implementation correctly raised ValueError. Handle the
decimal-separator case before the generic end-of-substring check so an
empty fraction is rejected.1 parent a6c2d4a commit 54ecfa5
3 files changed
Lines changed: 23 additions & 7 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Library
- Modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3758 | 3758 | | |
3759 | 3759 | | |
3760 | 3760 | | |
| 3761 | + | |
| 3762 | + | |
| 3763 | + | |
| 3764 | + | |
3761 | 3765 | | |
3762 | 3766 | | |
3763 | 3767 | | |
| |||
5003 | 5007 | | |
5004 | 5008 | | |
5005 | 5009 | | |
| 5010 | + | |
| 5011 | + | |
| 5012 | + | |
| 5013 | + | |
5006 | 5014 | | |
5007 | 5015 | | |
5008 | 5016 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1034 | 1034 | | |
1035 | 1035 | | |
1036 | 1036 | | |
1037 | | - | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
1038 | 1047 | | |
1039 | 1048 | | |
1040 | 1049 | | |
1041 | 1050 | | |
1042 | 1051 | | |
1043 | 1052 | | |
1044 | 1053 | | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | 1054 | | |
1052 | 1055 | | |
1053 | 1056 | | |
| |||
0 commit comments