mxmlnkn <[email protected]> added the comment:
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)))'
[]
----------
status: pending -> open
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40757>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com