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