Closed shubhamdotjain closed 6 years ago
It's best to rewrite it to use the gzip
module instead of subprocess. There is an example of compressing a file in the documentation (https://docs.python.org/3/library/gzip.html), and you can easily adjust it to do decompression. Want to give it a try?
Sure. I have sent the patch for the same.
Merged as commit b3e470c48bfe021c7ea9f01173aea4b1b95522b7.
In class PatchewTestCase,
def get_data_path(self, fname): r = tempfile.NamedTemporaryFile(dir=RUN_DIR, prefix="test-data-", delete=False) d = os.path.join(BASE_DIR, "tests", "data", fname) r.write(subprocess.check_output(["zcat", d])) r.close() return r.name
zcat doesn't stat the ".gz" files. Changing into gzcat worked for me.