I'm trying to use Python's package subprocess to gunzip and gzip files. I'm using the following command:
subprocess.call(['gunzip', a_path+myfile_gz], shell=True)
Then I get the error message:
gzip: compressed data not read from a terminal. Use -f to force decompression.
So I typed:
subprocess.call(['gunzip', '-f', a_path+myfile_gz], shell=True)
And I get exactly the same error message.
If I type shell=False, it's worse.
It's really weird because if I do it from my terminal, it works fine! Does anybody knows what's wrong?
" ".join(['gunzip', a_path+myfile_gz])– scai Sep 4 '12 at 6:47shell=False? It works for me when I do that. – daniel kullmann Sep 4 '12 at 8:21