[issue30684] datetime.fromtimestamp raises OSError on first day after epoch on Windows

2017-06-16 Thread R. David Murray
R. David Murray added the comment: This appears to be a duplicate of issue 29097. -- nosy: +r.david.murray resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> datetime.fromtimestamp(t) when 0 <= t <= 86399 fails on Python 3.6 ___

[issue30684] datetime.fromtimestamp raises OSError on first day after epoch on Windows

2017-06-16 Thread Eryk Sun
Eryk Sun added the comment: This is due to computing the PEP 495 fold in the function datetime_from_timet_and_us in Modules/_datetimemodule.c. It computes the local time for (timet - max_fold_seconds), which is negative for timestamps less than max_fold_seconds (86400). It's documented that lo

[issue30684] datetime.fromtimestamp raises OSError on first day after epoch on Windows

2017-06-16 Thread Christoph Reiter
New submission from Christoph Reiter: I'm not sure this is a bug since the docs says raising OSError is allowed, but it looks weird to me. On Windows. Using Python 3.4: >>> datetime.datetime.fromtimestamp(0) datetime.datetime(1970, 1, 1, 1, 0) Using Python 3.6.1: >>> datetime.datetime.fromt