New submission from Jordon Phillips: In Python 3.6.0 if you give datetime.fromtimestamp a very bad value you either get a core dump or an OverflowError. The core dump occurs when no tzinfo is provided, the OverflowError occurs when a tzinfo is provided (such as tzlocal from dateutil). Attached is a minimal script to reproduce the error. Note that this behavior only occurs on certain systems. It does not happen on OSX 10.11.6, but it does happen on Ubuntu 12.04. I imagine it happens on other systems as well, but I haven't tested beyond those two.
Here are the specific errors I get on Ubuntu 12.04. When no tzinfo is provided: python: /tmp/python-build.20161228223921.28011/Python-3.6.0/Modules/_datetimemodule.c:251: days_before_year: Assertion `year >= 1' failed. Aborted (core dumped) When a tzinfo is provided: Traceback (most recent call last): File "test1.py", line 11, in <module> datetime.fromtimestamp(bad_st_mtime, local_time_zone) File "~/.pyenv/versions/venv36d/lib/python3.6/site-packages/dateutil/tz/_common.py", line 210, in fromutc dt_wall = self._fromutc(dt) File "~/.pyenv/versions/venv36d/lib/python3.6/site-packages/dateutil/tz/_common.py", line 195, in _fromutc return dt + dtdst OverflowError: date value out of range I imagine this is related to the fold changes. ---------- components: Library (Lib) files: test.py messages: 284218 nosy: Jordon Phillips priority: normal severity: normal status: open title: Core dump / OverflowError for datetime.fromtimestamp with overly large timestamp in Ubuntu 12.04 type: behavior versions: Python 3.6 Added file: http://bugs.python.org/file46068/test.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29100> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com