dateutil parser bug for years < 100
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dateutil |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
dateutil parser erroneously ignores significant leading year digits for 4-digit years < 100:
(Python 2.7.3)
>>> import datetime
>>> import dateutil
>>> import dateutil.parser
>>> dateutil.
'1.5'
>>> dt = datetime.
>>> print dt.isoformat()
0003-02-01T00:00:00
>>> dateutil.
>>> dateutil.
'2003-02-
>>>
>>> dt = datetime.
>>> print dt.isoformat()
0099-02-01T00:00:00
>>> dateutil.
'1999-02-
Looks like the significant leading digits get ignored, triggering the 2-digit-year rules.
Years >= 100 work as expected:
>>> dt = datetime.
>>> dateutil.
'0100-02-
>>>
A note for posterity: This has long(?) been fixed - modern dateutil versions (e.g. 2.8.1) do not suffer from this bug anymore.
(dateutil issue tracking has moved to GitHub years ago)