error when creating datetime.time with dateutil.tz.tzlocal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dateutil |
New
|
Undecided
|
Unassigned |
Bug Description
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=
>>> t2 = datetime.time(1, 2, tzinfo=
>>> 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/
if self._isdst(dt):
File "/usr/lib/
+ dt.second)
AttributeError: 'NoneType' object has no attribute 'toordinal'
My locale timezone is "Europe/Prague", python2.6, dateutil 1.4.1, debian linux.