Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

tarfile.py: TarFile.addfile not adding all files #116931

Closed
Labels
3.11only security fixes3.12only security fixes3.13bugs and security fixestype-bugAn unexpected behavior, bug, or error
@elehcimd

Description

@elehcimd

Bug report

Bug description:

I would expect both filesA andB to be stored in the tar file. However, onlyA is archived.

# creating the test directory!rm -rf test1.tar test1!mkdir test1!echo thisisa>test1/A!echo thisisb>test1/B
importtarfilearchive=tarfile.open("test1.tar",mode="w",format=tarfile.GNU_FORMAT)archive.addfile(archive.gettarinfo(name="test1/A"))archive.addfile(archive.gettarinfo(name="test1/B"))archive.close()print(tarfile.open("test1.tar",mode="r").getnames())

Expected output:

['test1/A', 'test1/B']

Returned output:

['test1/A']

Reproduced on these Python versions:

Python 3.11.6 (main, Nov 28 2023, 09:22:32) [Clang 14.0.0 (clang-1400.0.29.202)] on darwinPython 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux

CPython versions tested on:

3.11

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixes3.13bugs and security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp