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
The serialization writers use str(timedelta) for duration values, but the shared duration reader only accepts ISO8601 strings and the legacy hh:mm[:ss] form. Python's native representation adds a day prefix and/or fractional seconds for other values, which the reader rejects.
Examples from current main (2d0360710c6ee48f4b1a9f805c5d3d8302c935e2):
The assertion cannot be reached because parsing raises ValueError. This also affects a positive microsecond, a negative duration such as timedelta(microseconds=-1), and timedelta.max / timedelta.min.
The JSON and form writers emit the string but their readers return None; the text reader raises. Whole-hour durations such as 2:00:00 still work.
A focused fix can extend the existing native-format fallback to accept the optional signed day prefix and up to six fractional-second digits, using integer day/second/microsecond components. Existing serialized content and the ISO parser can remain unchanged. This is separate from #867's ISO component-presence validation.
Activity