- changed status to resolved
Durations with trailing garbage are parsed successfully
Issue #9
resolved
Any nonsense can be put after a duration, and the parser will succeed:
>>> aniso8601.parse_duration('P1Dasdfasdf')
datetime.timedelta(1)
This also affects intervals that contain durations:
>>> aniso8601.parse_interval('2001/P1Dasdf')
(datetime.date(2001, 1, 1), datetime.date(2001, 1, 2))
>>> aniso8601.parse_interval('P1Dasdf/2001')
(datetime.date(2001, 1, 1), datetime.date(2000, 12, 31))
I would expect exceptions to be raised instead.
This is with aniso8601 1.1.0.
Comments (1)
-
repo owner - Log in to comment
Fixed in 1.2.0.