bpo-26669: Reject float infinity in time functions by vstinner · Pull Request #11507 · python/cpython
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters