Repository navigation
Conversation
Darlokt
force-pushed
the
source-date-epoch-consumers
branch
from
October 24, 2026 12:35
5a86e55 to
b33f398
Compare
Contributor
Author
|
The force push was to rebase, for a cleaner diff. |
This was referenced Oct 24, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Hej,
as requested by @AA-Turner, here is the first of 3 more reviewable split up of the main PR #14770 targeting the
SOURCE_DATE_EPOCHbehavior and related fixes.The consumers currently parse the variable independently, with different behavior for empty values, epoch zero, and invalid input. This change introduces a shared parser and uses it in date formatting, EPUB metadata, gettext, and copyright handling. Unset and empty values are treated as absent, and
0is a valid timestamp. Non-empty values must match-?[0-9]+: leading zeros are accepted, while whitespace, plus signs, underscores, non-ASCII digits, and fractional values are rejected. With this it changes accepted input and is not solely a refactor.Gettext calculates its timestamp when the builder initializes instead of when its module is imported. Separate builds in the same process can therefore use different epochs, while each builder retains a single timestamp for its output.
Copyright
%Yplaceholders use the epoch's UTC year directly, capped at the current local year. Substitution works independently of surrounding punctuation, including2000–%Y, Alice. Existing restrictions on correcting static copyright years are preserved and documented.The change includes tests, documentation, and a changelog entry. The cache invalidation and Docutils compatibility changes from the original PR are covered by parts 2 and 3. For a more info on the reasoning, see the original PR, for a clean merge and CI testing I still recommend merging #14770, when everything is ironed out.
References
2026, My Nameresults in 1980. Other separators work #14657.AI Disclosure
OpenAI Codex assisted with splitting up #14770. All AI-assisted work was reviewed and understood by me.