Closed aosingh closed 3 weeks ago
Using datetime.timestamp() for timestamps close to EPOCH fails on Windows crashing Python.
datetime.timestamp()
Please check this run https://github.com/apache/arrow-nanoarrow/actions/runs/9428246621/job/25973355558
Following snippet
def test_c_array_timestamp_microseconds(): d1 = int(round(datetime(1970, 1, 1).timestamp() * 1e6))
raises error
OSError: [Errno 22] Invalid argument
The crux of the problem is explained in this CPython issue. Solution is to use timezone aware datetime objects
Using
datetime.timestamp()
for timestamps close to EPOCH fails on Windows crashing Python.Please check this run https://github.com/apache/arrow-nanoarrow/actions/runs/9428246621/job/25973355558
Following snippet
raises error
The crux of the problem is explained in this CPython issue. Solution is to use timezone aware datetime objects