-
-
Notifications
You must be signed in to change notification settings - Fork 34.8k
gh-152849: Fix OverflowError message for out-of-range float timestamps #152850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d4764cd
453a2bb
a23c23f
6840090
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be in Library.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved to |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Fix the :exc:`OverflowError` message for out-of-range float timestamps: it | ||
| now names ``PyTime_t`` instead of ``time_t``. Patch by tonghuaroot. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,7 +107,7 @@ static void | |
| pytime_overflow(void) | ||
| { | ||
| PyErr_SetString(PyExc_OverflowError, | ||
| "timestamp too large to convert to C PyTime_t"); | ||
| "timestamp out of range for C PyTime_t"); | ||
| } | ||
|
|
||
|
|
||
|
|
@@ -636,7 +636,7 @@ pytime_from_double(PyTime_t *tp, double value, _PyTime_round_t round, | |
|
|
||
| /* See comments in pytime_double_to_denominator */ | ||
| if (!((double)PyTime_MIN <= d && d < -(double)PyTime_MIN)) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The error message of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, updated to |
||
| pytime_time_t_overflow(); | ||
| pytime_overflow(); | ||
| *tp = 0; | ||
| return -1; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.