[issue40757] tarfile: ignore_zeros = True won't raise exception even on invalid (non-zero) TARs

2022-01-23 Thread Irit Katriel
Irit Katriel added the comment: Thank you for clarifying. I can reproduce this on 3.11. -- resolution: out of date -> versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 ___ Python tracker

[issue40757] tarfile: ignore_zeros = True won't raise exception even on invalid (non-zero) TARs

2022-01-21 Thread mxmlnkn
mxmlnkn 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):

[issue40757] tarfile: ignore_zeros = True won't raise exception even on invalid (non-zero) TARs

2022-01-21 Thread Irit Katriel
Irit Katriel added the comment: I am unable to reproduce this on 3.11: >>> import tarfile >>> tarfile.open( "foo.txt" ) Traceback (most recent call last): File "", line 1, in File "/Users/iritkatriel/src/cpython-1/Lib/tarfile.py", line 1613, in open return func(name, "r", fileobj,

[issue40757] tarfile: ignore_zeros = True won't raise exception even on invalid (non-zero) TARs

2020-05-24 Thread mxmlnkn
New submission from mxmlnkn : Normally, when opening an existing non-TAR file, e.g., a file with random data, an exception is raised: tarfile.open( "foo.txt" ) --- ReadError