isodate icon indicating copy to clipboard operation
isodate copied to clipboard

isodate.duration_isoformat does not raise Exception for wrong input type

Open GiorgioBalestrieri opened this issue 6 years ago • 0 comments

Hi,

I just noticed that isodate.duration_isoformat does not raise an Exception if invalid inputs are passed, even if the type is wrong. Instead, it returns 'P%P'. I don't know the internals, but a check on the validity of the inputs would make this much safer.

>>> isodate.duration_isoformat('ajaksdf')
'P%P'
>>> isodate.duration_isoformat(1000)
'P%P'

GiorgioBalestrieri avatar Feb 13 '19 10:02 GiorgioBalestrieri