Invalid relativedelta object when float `second` is given
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dateutil |
New
|
Undecided
|
Unassigned |
Bug Description
relativedelta should not allow float arguments for the `second` (and other) keyword arguments; this results in invalid objects that raise errors when used.
>>> from dateutil.
>>> import datetime
>>> relativedelta(
relativedelta(
>>> relativedelta(
relativedelta(
>>> datetime.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
ret = (other.
TypeError: integer argument expected, got float
Either __init__ should catch the error early or the value should be normalized and converted to int.