Skip to content

Use locale-independent HTTP dates for conditional requests - #122

Open
KennyMcSimpson wants to merge 1 commit into
python-jsonschema:mainfrom
KennyMcSimpson:fix/http-cache-date
Open

KennyMcSimpson wants to merge 1 commit into
python-jsonschema:mainfrom
KennyMcSimpson:fix/http-cache-date

Conversation

@KennyMcSimpson

Copy link
Copy Markdown

A repeated Sphinx build on Chinese-locale Windows fails with UnicodeEncodeError when a specification cache exists: strftime puts localized weekday/month names into If-Modified-Since. The same format also sends an afternoon timestamp such as 15:04 as 03:04.

Use email.utils.format_datetime(..., usegmt=True) to send an English, 24-hour GMT HTTP date. Add regressions with a fixed afternoon timestamp under the C and system locales, and install pytest in the typing session for the new test import.

Validation: Nox tests on Python 3.11/3.12/3.13, style, typing, documentation HTML/doctests/style, build/Twine, and changed-file pre-commit checks pass. The previously failing cached documentation build of referencing also succeeds with this source. Both new regression cases fail before the fix.

AI assistance: OpenAI Codex prepared the change, tests, and this description.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant