patchew-project / patchew

A patch email tracking and testing system
MIT License
73 stars 24 forks source link

zcat doesn't work for mac os #74

Closed shubhamdotjain closed 6 years ago

shubhamdotjain commented 6 years ago

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.

bonzini commented 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?

shubhamdotjain commented 6 years ago

Sure. I have sent the patch for the same.

bonzini commented 6 years ago

Merged as commit b3e470c48bfe021c7ea9f01173aea4b1b95522b7.