humanize() says "in 0 seconds" for past datetimes on Python 3.13 #2291
Since upgrading to 4.2.0, anything in the past comes back as the future:
from datetime import datetime, timedelta, timezone
from when import humanize
past = datetime.now(timezone.utc) - timedelta(minutes=5)
print(humanize(past)) # "in 0 seconds", expected "5 minutes ago" when 4.2.0, Python 3.13.1, Ubuntu 24.04
/repro
The snippet fails exactly as reported. It passes on 4.1.3, so this looks like a regression in 4.2.0.
| when | 4.2.0 (from the report), also tried 4.1.3 |
| Runtime | CPython 3.13.1, Ubuntu 24.04, x86_64, TZ=UTC |
| Snippet | Run unchanged, 1 file, 5 lines |
Run it yourself:
Ran in 58s on a disposable VM, now deleted.