Skip to content

Instantly share code, notes, and snippets.

View chadmiller-amzn's full-sized avatar

Chad Miller chadmiller-amzn

View GitHub Profile
@chadmiller-amzn
chadmiller-amzn / python_reads_tar_xz.py
Created May 8, 2018 16:44
Python tarfile module xz support
# Join us. https://aws.amazon.com/careers/linux-jobs/
import tarfile
# Add xz support to tarfile
# Is only read-only FIXME
# Only works on named files FIXME
if "xz" not in tarfile.TarFile.OPEN_METH:
def _xzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
import tempfile, subprocess