| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The pure-Python parser divided the fractional part by 10 regardless of length, so P1.25D read as 1 day plus 60 hours. Only single-digit fractions were correct, and the four components shared the assumption.
| Back | FazBrowse Home | New Git URL |
The pure-Python ISO 8601 parser divides a fractional part by 10 whatever its length:
So "1.25" gives int("25") / 10, which is 2.5 days instead of 0.25.
Single-digit fractions are right, which is why P1.5D looks fine and hides it. The same / 10 appears for weeks, days, hours and minutes, so all four scale wrong together.
This is the fallback path, reached through PENDULUM_EXTENSIONS=0 or when the extension will not import, so the Rust parser isn't affected and gives the right answers throughout.
Dividing by 10 ** len(part) is the whole change. That's it.
The tests import parse_iso8601 directly, since parse goes through the extension and would not exercise this. P1.5D is in the table as a control: it passes either way, so the other four failing on revert is the fix and not the test. Suite is 1843 passing with PENDULUM_EXTENSIONS=0 and 1843 with the extension, up from 1838 both ways.