Activity log for bug #1256908

Date Who What changed Old value New value Message
2013-12-02 12:13:21 Jan Spurny bug added bug
2013-12-02 12:15:25 Jan Spurny description Creating datetime.time with dateutil.tz.tzlocal fails creates valid datetime.time object, but this object raises error when __str__, __repr__ or isoformat method is called on it. Demonstration: >>> import datetime >>> import dateutil.tz >>> t1 = datetime.time(1, 2, tzinfo=dateutil.tz.tzutc()) >>> t2 = datetime.time(1, 2, tzinfo=dateutil.tz.tzlocal()) >>> t1 datetime.time(1, 2, tzinfo=tzutc()) >>> t2 datetime.time(1, 2, tzinfo=tzlocal()) >>> print t1 01:02:00+00:00 >>> print t2 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/pymodules/python2.6/dateutil/tz.py", line 92, in utcoffset if self._isdst(dt): File "/usr/lib/pymodules/python2.6/dateutil/tz.py", line 134, in _isdst + dt.second) AttributeError: 'NoneType' object has no attribute 'toordinal' My locale timezone is "Europe/Prague", python2.6, dateutil 1.4.1, debian linux. Creating datetime.time with dateutil.tz.tzlocal creates valid datetime.time object, but this object raises error when __str__, __repr__ or isoformat method is called on it. Demonstration:  >>> import datetime  >>> import dateutil.tz  >>> t1 = datetime.time(1, 2, tzinfo=dateutil.tz.tzutc())  >>> t2 = datetime.time(1, 2, tzinfo=dateutil.tz.tzlocal())  >>> t1  datetime.time(1, 2, tzinfo=tzutc())  >>> t2  datetime.time(1, 2, tzinfo=tzlocal())  >>> print t1  01:02:00+00:00  >>> print t2  Traceback (most recent call last):    File "<stdin>", line 1, in <module>    File "/usr/lib/pymodules/python2.6/dateutil/tz.py", line 92, in utcoffset      if self._isdst(dt):    File "/usr/lib/pymodules/python2.6/dateutil/tz.py", line 134, in _isdst      + dt.second)  AttributeError: 'NoneType' object has no attribute 'toordinal' My locale timezone is "Europe/Prague", python2.6, dateutil 1.4.1, debian linux.
2015-07-19 13:19:16 Roman Andriadi bug added subscriber Roman Andriadi