isodate
isodate copied to clipboard
isodate.duration_isoformat does not raise Exception for wrong input type
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'