Skip to content

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