Repository navigation
Preserve Unicode strftime output in non-UTF-8 locales - #9050
Conversation
Assisted-by: OpenAI Codex:model identifier unavailable
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to This change preserves localized Unicode strftime output on Linux and macOS. No actionable merge-blocking risk was identified; hosted CI and macOS validation remain pending. Pre-merge checks |
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd23fb61de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| #[cfg(windows)] | ||
| // These Unix platforms provide wcsftime, which returns locale text as Unicode. |
There was a problem hiding this comment.
Add the required AI-assistance trailer
This commit states that it was AI-assisted, but its message ends with prose rather than the mandatory Assisted-by: AGENT_NAME:MODEL_VERSION trailer, so it does not meet the repository's critical disclosure policy; add the prescribed trailer before landing.
AGENTS.md reference: AGENTS.md:L20-L23
Useful? React with 👍 / 👎.
| except locale.Error: | ||
| continue | ||
| february = (2024, 2, 1, 12, 0, 0, 3, 32, 0) | ||
| assert time.strftime("%B", february) == "février" |
There was a problem hiding this comment.
Remove the prohibited test logic
The newly added locale block changes test data, control flow, and assertions in an existing snippet test, but the repository's critical test-file policy permits only expected-failure decorator and associated TODO edits. Drop this regression block rather than modifying stdlib_time.py as part of the fix.
AGENTS.md reference: AGENTS.md:L273-L279
Useful? React with 👍 / 👎.
Summary
Extract the independent Linux/macOS
strftimelocale-output fix from #8954 (43065e79ddc46eafeca58cb39398ac007b5d25f7) onto Python 3.14 main (3af5f8a15314446d2b28a90e429c938dc7b8beeb).Use
wcsftimeon Linux and macOS rather than interpreting narrow libc output as UTF-8. This preserves localized month/day text when the selected locale uses another encoding. Windows is unchanged, and other Unix targets retain the existing narrow fallback, including OpenBSD.The production hunks are taken directly from the pinned mega PR and match CPython 3.14.7's wide-formatting path. No Python 3.15 behavior or unrelated migration changes are included. Searches found no dedicated duplicate; merged #7090 is Windows-specific, and #7671 covers earlier Unicode literal passthrough.
Add bounded coverage to the existing time snippet for localized output, Unicode/surrogate/NUL composition, and buffer growth. Save/set/restore
LC_ALL, since macOS's libc conversion also depends onLC_CTYPE. Locales remain optional for hosts where they are not installed; the local verification explicitly exercised both rather than silently skipping them.Validation
LC_TIMEandLC_CTYPEare set to each requested locale and produces the correct Unicode month in both encodings.TimeTestCasestrftime tests pass, including Unicode/surrogate/NUL and format/bounds checks.wchar_tlayout, initialized buffers, lengths, lifetimes and growth, and caught/corrected the macOS locale-category test assumption.No canonical assertions, implementation-name guards, or README text were changed; no Rust behavioral tests were added. Native validation is Linux-only, not a complete workspace or macOS execution claim. Full hosted CI is pending; this remains a draft for review.
AI-assisted implementation and validation with OpenAI Codex; model identifier unavailable. No human review is implied.
Summary by CodeRabbit