Skip to content

gh-135253: Document tarfile stream restrictions and examples - #159836

Open
limadog9 wants to merge 1 commit into
python:mainfrom
limadog9:gh-135253-tar-stream-docs
Open

limadog9 wants to merge 1 commit into
python:mainfrom
limadog9:gh-135253-tar-stream-docs

Conversation

@limadog9

@limadog9 limadog9 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Document the forward-only behavior of tarfile stream modes at the lookup, listing, and extraction methods. Explain when to pass the current TarInfo object and why listing or looking up members can prevent later extraction.

Add a streaming file-reading example, adapt the filtered extractall() example to stream mode, and document StreamError for backward seeking and extracting links as file objects.

Fixes #135253.

Validation:

  • Executed the new reading example against a generated gzip archive and checked lookup/list restrictions, link errors, and filtered stream extraction on the current CPython debug build.
  • Full HTML documentation build with warnings treated as errors.
  • Sphinx lint and patchcheck.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35258512 | 📁 Comparing 7aac4ec against main (0fba211)

  🔍 Preview build  

1 file changed
± library/tarfile.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

tarfile stream restrictions should be documented

1 participant