The Python tarfile module ignores errors during extraction by default if it is errorlevelnot set to 1or 2(or from debugto 1, if you want to print only error messages).
Try mkdir /tmp/foo && sudo chown root /tmp/foo && chmod a-w /tmp/fooand use tarfile.tar.gz to extract the file to /tmp/foo- you will see that your Python code did not rule out at all. Files would not be extracted on top /tmp/foo, which is still an empty directory.
Why is this behavior? Who / what benefits from this default behavior ? In other words, who or what would like to ignore, say, tarfile decompression errors?
source
share