You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues of this repo and believe that this is not a duplicate.
OS version and name: MacOS 14.5
Pendulum version: 3.0
Issue
While tinkering with Duration, I found several bugs and edge cases that might be good to patch:
Parsing partially ignores long numbers
>>>parse ('PT999900000000000000000000000000000002S')
Duration(seconds=2) # earlier digits get forgotten
Incorrectly duplicated components are parsed anyway, with inconsistent results
>>>parse("P12M4M")
Duration(months=4) # should be an error, but takes the last one>>>parse("PT12M3M1M")
Duration(minutes=16) # should also be an error, but sums them
Values overflow
>>>parse("PT4294967297M")
Duration(minutes=1)
'empty' duration shouldn't be allowed
>>>parse('PT')
Duration() # should be an error, this isn't allowed in ISO8601
Issue
While tinkering with
Duration
, I found several bugs and edge cases that might be good to patch:Parsing partially ignores long numbers
Incorrectly duplicated components are parsed anyway, with inconsistent results
Values overflow
'empty' duration shouldn't be allowed
Strange month arithmetic
Probably related to #799
The text was updated successfully, but these errors were encountered: