MozaicWorks / DMARCReporting

Simple tool to extract error reports from DMARC files
MIT License
11 stars 2 forks source link

Workaround OSError: not a gzipped file when the gzip has trailing garbage #18

Closed tdpauw closed 11 months ago

tdpauw commented 1 year ago

Python's gzip module fails to decompress gzip files with trailing garbage (python/cpython#68489). The gzip command is however able to decompress such files.

$ gunzip noname-189fc9925fed91f8.gz
gunzip: noname-189fc9925fed91f8.gz: trailing garbage ignored

Example gzip causing the error: noname-189fc9925fed91f8.gz

A possible workaround can be found in How to Ignore Gzip Trailing Garbage Data in Python.

maathieu commented 1 year ago

Duplicate of #68489 ?

tdpauw commented 1 year ago

Duplicate of #68489 ?

Not really a duplicate, but it is exactly that issue that we need to find a workaround for.

tdpauw commented 11 months ago

@maathieu comment on Mar 29 to python/cpython#68489 seems to be a simpler workaround. Implemented that.