Skip to content

Parse timezone names with multiple slash-separated components - #1044

Open
FanWu-ai wants to merge 1 commit into
python-pendulum:masterfrom
FanWu-ai:fix-nested-timezone-format-20261011
Open

FanWu-ai wants to merge 1 commit into
python-pendulum:masterfrom
FanWu-ai:fix-nested-timezone-format-20261011

Conversation

@FanWu-ai

Copy link
Copy Markdown
Contributor

from_format() rejects valid timezone names containing more than one slash, such as America/Argentina/Buenos_Aires and America/Indiana/Indianapolis. This prevents round trips of strings produced by Pendulum's own format() method.

Allow repeated slash-separated components in the z token's timezone pattern. Existing validation against known timezones remains unchanged, so malformed and unknown names are still rejected. Add regressions and a documentation example.

Validation on Linux / Python 3.12.14:

  • Before edits, complete pure-Python and native suites each passed 1,871 tests with 3 existing skips.
  • Original source fails 24 of the 42 new regression/control cases in both backends; all pass after the fix.
  • Final complete source and clean release-wheel suites each pass 1,913 tests in both backends, with the same 3 skips (one Windows-only and two upstream POSIX-transition tests).
  • All 3,594 round trips across 599 installed timezones pass in each backend; an independent 208-case check covers all 26 multi-component names.
  • Mypy, all configured prek hooks including Rust formatting/Clippy, strict docs, release wheel/sdist, strict Twine checks, and whitespace checks pass.
  • Built wheel formatter bytes match tested source; clean-wheel suites run without typing_extensions.

Docs retain six existing INFO-level broken-anchor diagnostics, and the sdist build retains an existing Cargo metadata warning. Other Python versions and native operating systems were not tested locally. Hosted CI has not run yet.

AI assistance: OpenAI Codex was used to investigate, implement, document, and test this fix.

AI assistance: OpenAI Codex was used for investigation, implementation, regression tests, and automated validation.
@FanWu-ai
FanWu-ai marked this pull request as ready for review October 11, 2026 16:28
@codspeed

codspeed Bot commented Oct 11, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 1 benchmark spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 1 benchmark has no flame graph

The flamegraph could not be generated because we failed to resolve the symbols in the profiling trace. This happens when we fail to harvest information about language frames.

✅ 1 untouched benchmark


Comparing FanWu-ai:fix-nested-timezone-format-20261011 (716e85b) with master (7840d47)

Open in CodSpeed

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