[New-bugs-announce] [issue38645] datetime.datetime.fromtimestamp(0, tzlocal()) throws error

Michael Zhang report at bugs.python.org
Wed Oct 30 11:07:25 EDT 2019


New submission from Michael Zhang <mzhangthirteen at gmail.com>:

Discovered this while trying to use a function in `boto3`. Seems like when tzlocal() is passed with a 0 to datetime.datetime.fromtimestamp(), it throws an "[Errno 22] Invalid argument" error. Using 3.7.4 via Anaconda on Windows 10, and tzlocal().tznames's local timezone for me is EST/EDT.

Can replicate through this:
```
import datetime
from dateutil.tz import tzlocal

print(datetime.datetime.fromtimestamp(0, tzlocal()))
```

----------
messages: 355720
nosy: mzhang13
priority: normal
severity: normal
status: open
title: datetime.datetime.fromtimestamp(0, tzlocal()) throws error
type: crash
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38645>
_______________________________________


More information about the New-bugs-announce mailing list