Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bpo-26669: Reject float infinity in time functions #11507

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

Closed
wants to merge 1 commit into from
Closed

bpo-26669: Reject float infinity in time functions #11507

wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jan 10, 2019

bpo-26669, bpo-35707: Reject -inf and +inf floats in the following C
functions:

  • _PyTime_ObjectToDenominator()
  • _PyTime_ObjectToTime_t()
  • _PyTime_FromSecondsObject()
  • _PyTime_FromMillisecondsObject()

https://bugs.python.org/issue26669

bpo-26669, bpo-35707: Reject -inf and +inf floats in the following C
functions:

* _PyTime_ObjectToDenominator()
* _PyTime_ObjectToTime_t()
* _PyTime_FromSecondsObject()
* _PyTime_FromMillisecondsObject()
@vstinner
Copy link
Member Author

Currently, passing float("inf") fail with OverflowError("timestamp too large to convert to C _PyTime_t"). With this change, ValueError("invalid value: infinity") is raised explicitly.

... I'm not sure that it's really worth it / the correct behavior.

@vstinner
Copy link
Member Author

I lost track of this issue and so I close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants