Skip to content

gh-123059: Document archive timestamp timezone handling - #155195

Open
JasonColapietro wants to merge 1 commit into
python:mainfrom
JasonColapietro:agent/document-archive-timezones
Open

gh-123059: Document archive timestamp timezone handling#155195
JasonColapietro wants to merge 1 commit into
python:mainfrom
JasonColapietro:agent/document-archive-timezones

Conversation

@JasonColapietro

@JasonColapietroJasonColapietro commented Aug 4, 2026

Copy link
Copy Markdown

Closes#123059.

This documents the different timestamp behavior used when adding filesystem entries to ZIP and tar archives:

  • ZipFile.write() converts the filesystem modification time to the current local time, which can make otherwise identical archives differ across time zones. The docs now show how to supply an explicit ZipInfo.date_time with writestr() when the timestamp must be controlled.
  • TarFile.add() stores the modification time as epoch seconds without a local-time conversion, while noting that filesystem-provided timestamps may still be time-zone-dependent.

Checks:

  • sphinx-lint on Doc/library/zipfile.rst and Doc/library/tarfile.rst
  • targeted Sphinx HTML build with warnings treated as errors
  • git diff --check

Developed with help from Codex. I reviewed and understand the change.

@bedevere-appbedevere-appBot added docs Documentation in the Doc dir skip news labels Aug 4, 2026
@python-cla-bot

python-cla-botBot commented Aug 4, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33915708 | 📁 Comparing 56fae89 against main (30ac23e)

🔍 Preview build

2 files changed
±library/tarfile.html
±library/zipfile.html

@JasonColapietro
JasonColapietro marked this pull request as ready for review August 5, 2026 01:46
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviewdocsDocumentation in the Doc dirskip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

zipfile and tarfile docs should cover local timezone impact on entry timestamps

1 participant

@JasonColapietro