Ammar Askar <[email protected]> added the comment:
It is windows specific, but I don't think this is a dateutil bug rather than
the python stdlib:
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> from dateutil.tz import tzlocal
>>> print(datetime.datetime.fromtimestamp(0, tzlocal()))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Python365\lib\site-packages\dateutil\tz\_common.py", line 144, in
fromutc
return f(self, dt)
File "D:\Python365\lib\site-packages\dateutil\tz\_common.py", line 258, in
fromutc
dt_wall = self._fromutc(dt)
File "D:\Python365\lib\site-packages\dateutil\tz\_common.py", line 238, in
_fromutc
dtdst = enfold(dt, fold=1).dst()
File "D:\Python365\lib\site-packages\dateutil\tz\tz.py", line 225, in dst
if self._isdst(dt):
File "D:\Python365\lib\site-packages\dateutil\tz\tz.py", line 288, in _isdst
if self.is_ambiguous(dt):
File "D:\Python365\lib\site-packages\dateutil\tz\tz.py", line 250, in
is_ambiguous
(naive_dst != self._naive_is_dst(dt - self._dst_saved)))
File "D:\Python365\lib\site-packages\dateutil\tz\tz.py", line 254, in
_naive_is_dst
return time.localtime(timestamp + time.timezone).tm_isdst
OSError: [Errno 22] Invalid argument
As you can see, none of that backtrace is within Python, it's all inside
dateutil code. More than likely they are calling `time.localtime` with a value
of less than 0 which throws an error on Windows. (see also issue29097)
----------
nosy: +ammar2
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue38645>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com