Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Closed
vstinner wants to merge 1 commit into
python:masterpython/cpython:masterfrom
vstinner:pytime_infCopy head branch name to clipboard
Closed

bpo-26669: Reject float infinity in time functions#11507
vstinner wants to merge 1 commit into
python:masterpython/cpython:masterfrom
vstinner:pytime_infCopy head branch name to clipboard

Conversation

@vstinner

@vstinner vstinner commented Jan 10, 2019

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.