[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

[issue45287] zipfile.is_zipfile returns true for a rar file containing zips

2021-09-25 Thread mxmlnkn
New submission from mxmlnkn : I have created a RAR file containing two zip files like this: zip bag.zip README.md CHANGELOG.md zip bag1.zip CHANGELOG.md rar a zips.rar bag.zip bag1.zip And when calling `zipfile.is_zipfile` on zips.rar, it returns true even though it obviously is not a zip

[issue45286] zipfile missing API for links

2021-09-25 Thread mxmlnkn
New submission from mxmlnkn : When using zipfile as a library to get simple files, there is no way to method to determine whether a ZipInfo object is a link or not. Moreover, links can be simply opened and read like normal files and will contain the link path, which is unexpected in most

[issue40843] tarfile: ignore_zeros = True exceedingly slow on a sparse tar file

2020-06-02 Thread mxmlnkn
New submission from mxmlnkn : Consider this example replicating a real use case where I was downloading the 1.191TiB ImageNet in sequential order for ~1GiB in order to preview it: echo "foo" > bar tar cf sparse.tar bar #!/usr/bin/env python3 # -*- coding: utf-8 -*- import os i

[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" ) ---