Repository navigation
Format the expires header locale-independently - #705
Merged
Merged
Conversation
The C32 expires-header regression previously skipped on hosts with no non-English locale installed, so CI could not catch a recurrence of the locale-dependent strftime formatting. Replace the setlocale dance with a monkeypatch that forces the bucket module's datetime.strftime to emit non-English day/month names, so the test runs everywhere and fails if the formatter reverts to locale-dependent output.
8 tasks
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.
Context
Bucketformatted the "expires" header with locale-dependentstrftime('%a, %d %b %Y %H:%M:%S GMT'), so on a host with a non-EnglishLC_TIMEthe day/month names were wrong (e.g.Do, 01 Dez ...).Changes
Use a locale-independent formatter (
email.utils.format_datetime(expires, usegmt=True)).Verification
Regression asserts the header stays English regardless of locale, and runs on any host (no dependency on an installed OS locale): it passes with the fix and fails if reverted (
Do, 01 DezvsThu, 01 Dec). Bucket unit suite green; ruff clean; SDK panel PASS.Refs #703