Repository navigation
Conversation
…indows A key such as "America/C:\file" passed validation, and the tzdata loader then joined "C:\file" to the package directory, which replaced it. ANT-2026-IZMAOLCQ
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.
_validate_tzfile_path()now also checks each/-separated component of aZoneInfokey withos.path.splitroot()and raisesValueErrorif it has a drive or root. Before, a key such asAmerica/C:\Windows\win.inipassed validation on Windows, andload_tzdata()joinedC:\Windows\win.inito thetzdatapackage directory, which replaced it. No POSIX key changes behaviour, and all keys in the system time zone database still validate underntpath.I could not run this on Windows. The new test runs the validator with
os.pathswapped forntpath, so it exercises the Windows rules on every platform, but the end-to-end behaviour withtzdatainstalled on Windows is checked by code inspection only.The 3.11 backport needs a manual port:
os.path.splitroot()is new in 3.12, so the automated cherry-pick would produce code that fails there. On 3.11 the check can be written asos.path.splitdrive(component)[0] or os.path.isabs(component).Fixes #160420
ANT-2026-IZMAOLCQ
zoneinfo.ZoneInfoaccepts keys with a drive letter in a later component on Windows #160420