Python 3.6 datetime.fromtimestamp throws error when setting 0

In Python 3.5.2, this works:

datetime.datetime.fromtimestamp(0) returns -> datetime.datetime(1970, 1, 1, 1, 0) 

In Python 3.6, however, I get

 datetime.datetime.fromtimestamp(0) -> OSError: [Errno 22] Invalid argument 

I cannot find any changes to the function in the docs. I am curious why this violates my scripts now and where I can find the reasons.

Can anyone shed some light on this?

Python 3.6 REPL datetime.fromtimestamp error

+5
python datetime
source share
1 answer

This is a bug introduced in Python 3.6.0 for Windows only.
Details: https://bugs.python.org/issue29097

Patches are in the works, and most likely this will be fixed soon.

+10
source share

All Articles