Skip to content

gh-154667: Validate zipfile timestamps consistently#154740

Open
Taeknology wants to merge 1 commit into
python:mainfrom
Taeknology:fix/gh-154667-zipfile-timestamp-validation
Open

gh-154667: Validate zipfile timestamps consistently#154740
Taeknology wants to merge 1 commit into
python:mainfrom
Taeknology:fix/gh-154667-zipfile-timestamp-validation

Conversation

@Taeknology

@Taeknology Taeknology commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #154667.

ZipInfo now consistently rejects timestamps after 2107. When
strict_timestamps is false, ZipInfo.from_file() clamps filesystem
timestamps outside the supported range.

The upper limit is 2107-12-31 23:59:58 to account for the ZIP format's
two-second timestamp resolution.

Tests cover timestamp validation, clamping, local time conversion failures,
and ZIP round-tripping.

The targeted tests, full test_zipfile suite, reference leak checks, and
locally available CI checks pass.

Signed-off-by: Taeknology <20297177+Taeknology@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zipfile: Inconsistent and insufficient date_time validation and handling across ZipInfo methods

1 participant