This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mxmlnkn
Recipients iritkatriel, mxmlnkn
Date 2022-01-21.19:57:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642795046.77.0.779816080746.issue40757@roundup.psfhosted.org>
In-reply-to
Content
I think you misunderstood. foo.txt is a file, which actually exists but contains non-TAR data. E.g. try:

base64 /dev/urandom | head -c $(( 2048 ))  > foo.txt
python3 -c 'import tarfile; print(list(tarfile.open("foo.txt")))'

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.9/tarfile.py", line 1616, in open
    raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully

python3 -c 'import tarfile; print(list(tarfile.open("foo.txt", ignore_zeros=True)))'

[]
History
Date User Action Args
2022-01-21 19:57:26mxmlnknsetrecipients: + mxmlnkn, iritkatriel
2022-01-21 19:57:26mxmlnknsetmessageid: <1642795046.77.0.779816080746.issue40757@roundup.psfhosted.org>
2022-01-21 19:57:26mxmlnknlinkissue40757 messages
2022-01-21 19:57:26mxmlnkncreate