Gzip module does not support Unix compressed .Z files [SEC=UNOFFICIAL]

Robert Kern robert.kern at gmail.com
Mon Jul 4 10:18:25 EDT 2016


On 2016-07-04 09:00, dieter wrote:
> "Owen Brandon" <Brandon.Owen at ga.gov.au> writes:
>
>> I have a query regarding the support of decompression for Unix compressed .Z files in Python's gzip module. The gzip system utility supports this using the '-d' switch, but the python module does not.
>
> When I am right, then the "zipfile" module handles ".Z" compressed files.

No, that handles PKZIP .zip files. There are third-party modules that handle the 
.Z format, but shelling out to external programs may still be preferable:

   https://github.com/umeat/unlzw

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list