FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Tarfile to stdout documentation example · Issue #86608 · python/cpython · GitHub

Repository navigation

Tarfile to stdout documentation example #86608

Closed

Description

mannequin
BPO 42442

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2020-11-23.12:10:03.206>
labels = ['3.7', '3.8', '3.9', 'docs']
title = 'Tarfile to stdout documentation example'
updated_at = <Date 2020-11-23.12:10:03.206>
user = 'https://bugs.python.org/ilaughlin'

bugs.python.org fields:

activity = <Date 2020-11-23.12:10:03.206>
actor = 'ilaughlin'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2020-11-23.12:10:03.206>
creator = 'ilaughlin'
dependencies = []
files = []
hgrepos = []
issue_num = 42442
keywords = []
message_count = 1.0
messages = ['381665']
nosy_count = 2.0
nosy_names = ['docs@python', 'ilaughlin']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue42442'
versions = ['Python 3.6', 'Python 3.7', 'Python 3.8', 'Python 3.9']

Linked PRs

Activity

  1. ilaughlin commented on Nov 23, 2020

    ilaughlinmannequin
    MannequinAuthor

    Recommend adding example to tarfile documentation to provide example of writing a tarfile to stdout.

    example:

    files = [(file_1, filename_1), (file_2, filename_2)]
    
    
    with tarfile.open(fileobj=sys.stdout.buffer, mode = 'w|gz') as tar:
        for file, filename in files:
            file_obj = io.BytesIO() #starts a BytesIO object
            file_obj.write(file.encode('utf-8')) #writes the file to the BytesIO object
            info = tarfile.TarInfo(filename) #creates the TarInfo
            file_obj.seek(0) #goes to the beginning of the BytesIO object else it won't write
            info.size = len(file) #sets the length of the file
            tar.addfile(info, fileobj=file_obj) #writes the tar to stdout.
  2. transferred this issue fromon Apr 10, 2022
  3. added a commit that references this issue on Jul 20, 2025
  4. added 2 commits that reference this issue on Jul 20, 2025
  5. added a commit that references this issue on Jul 20, 2025
  6. added 2 commits that reference this issue on Jul 20, 2025
  7. added a commit that references this issue on Aug 4, 2025
  8. added a commit that references this issue on Aug 19, 2025
  9. added a commit that references this issue on Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL