Whole file

pganssle/zoneinfo

The author described this change as Fix support for numeric and julian offsets. It counts as a record because the check below fails on the code as it stood at 153e18fba and passes on e49b2bc3a, with nothing else changed between the two runs.

Fix saved2020-03-03
Sharing licenceApache-2.0 · LICENSE
Change size+1 4

What the code was meant to do, written into the code itself as a save note

Fix support for numeric and julian offsets

The change

606606 __slots__ = ["d", "julian", "hour", "minute", "second"]
607607
608608 def __init__(self, d, julian, hour=2, minute=0, second=0):
609- if julian:
610- d -= 1
611-
612609 if not 0 <= d <= 365:
613610 if julian:
614611 min_day = 1
630627 if self.julian and d >= 59 and calendar.isleap(year):
631628 d += 1
632629
633- epoch = days_before_year * 86400
630+ epoch = (days_before_year + d) * 86400
634631 epoch += self.hour * 3600 + self.minute * 60 + self.second
635632
636633 return epoch

The check that tells the two apart

failpass·tests/test_zoneinfo.py::TZStrTest::test_tzstr_from_utc

Check file tests/test_zoneinfo.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it153e18fba2ff23ab4ca492724622d10be01c5f38
Broken version dated2020-03-03
Modulezoneinfo._zoneinfo
Units changed_DayOffset
Fingerprint9b94431c4cee8d7c
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in pganssle/zoneinfo