-
-
Notifications
You must be signed in to change notification settings - Fork 970
Closed as not planned
Closed as not planned
Copy link
Labels
bugSomething isn't workingSomething isn't working
Description
🐛 Bug
OverflowError using datetime.fromtimestamp with a large negative number
To Reproduce
Using https://pyodide.org/en/stable/console.html
Welcome to the Pyodide terminal emulator 🐍
Python 3.10.2 (main, Apr 9 2022 20:52:01) on WebAssembly VM
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> datetime.fromtimestamp(-2147483649)
Traceback (most recent call last):
File "<console>", line 1, in <module>
OverflowError: timestamp out of range for platform time_t
I also get the error using node, see this build
Expected behavior
Outside wasm:
In [1]: datetime.fromtimestamp(-2147483649)
Out[1]: datetime.datetime(1901, 12, 13, 20, 9, 6)
Environment
- Pyodide Version: 0.21.0-alpha.2, also on https://pyodide.org/en/stable/console.html (Is there a way to get pyiodide version inside the interpreter? I tried
sys.versionandplatform, but couldn't fine it - Browser version: Version 103.0.5060.53 (Official Build) (arm64) and also node
v18on x86 - Any other relevant information: See this CI run
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working