{
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-18",
  "slug": "gzip",
  "term": "Gzip",
  "aliases": [
    "GZIP",
    ".gz"
  ],
  "definition": "Gzip is a lossless compressed-file format whose file consists of a sequence of members, each carrying a compressed data stream and a trailer with CRC32 and uncompressed size modulo 2^32.",
  "note": "A member is a compression-format unit, not necessarily a named TAR entry or the full intended recovery object. RFC 1952 defines the format; a surviving valid member cannot reveal that a different complete member was removed. [rfc1952]\n\nPython gzip.decompress supports concatenated members. In contrast, zlib's inflate interface stops at a member boundary; callers must continue with the remaining input when multiple members are intended. Python's object API exposes eof and unused_data for different questions: terminal state and bytes after that stream. [python-gzip] [python-zlib] [zlib-v13]\n\nIn Hesela's 42 bounded operations on CPython 3.12.3 and zlib 1.3, reading exactly 65,536 expected bytes then closing returned correct bytes without an error from a gzip whose CRC was deliberately damaged. Reading through EOF detected the discrepancy after returning the same payload. Removing one final trailer byte likewise escaped the exact-length read; decompressobj plus flush returned all bytes but left eof false. These are observations at recorded call sizes, not guarantees of error timing. [hesela-gzip]\n\nOn an intact two-member input, the single-member zlib call returned 65,536 of the required 98,304 bytes without an exception. Removing the second member entirely let whole-input gzip decoding succeed, but failed the separately fixed full-payload comparison. Require intended decoding coverage, terminal status and independent content expectations. A successful read or close alone is not whole-archive verification. [hesela-gzip]",
  "related": [
    "archive-member",
    "backup-manifest",
    "checksum",
    "zstandard",
    "restore-test"
  ],
  "citations": [
    {
      "id": "rfc1952",
      "title": "RFC 1952: GZIP file format specification 4.3, sections 2.2, 2.3.1 and 2.3.1.2",
      "url": "https://www.rfc-editor.org/rfc/rfc1952.html",
      "accessed": "2026-10-18"
    },
    {
      "id": "python-gzip",
      "title": "Python 3.12 gzip documentation: multi-member decompression and errors",
      "url": "https://docs.python.org/3.12/library/gzip.html",
      "accessed": "2026-10-18"
    },
    {
      "id": "python-zlib",
      "title": "Python 3.12 zlib documentation: eof, unused_data and unconsumed_tail",
      "url": "https://docs.python.org/3.12/library/zlib.html",
      "accessed": "2026-10-18"
    },
    {
      "id": "cpython-gzip",
      "title": "CPython v3.12.3 gzip.py: GzipFile.close and _GzipReader._read_eof",
      "url": "https://raw.githubusercontent.com/python/cpython/v3.12.3/Lib/gzip.py",
      "accessed": "2026-10-18"
    },
    {
      "id": "zlib-v13",
      "title": "zlib v1.3 public interface: inflate stops at a gzip member boundary",
      "url": "https://raw.githubusercontent.com/madler/zlib/v1.3/zlib.h",
      "accessed": "2026-10-18"
    },
    {
      "id": "hesela-gzip",
      "title": "Hesela: 42 gzip API operations distinguish trailer checks, member completion and expected content",
      "url": "https://hesela.com/analyses/compressed-archives-dictionary-dependencies/#gzip-coverage",
      "accessed": "2026-10-18"
    }
  ],
  "provenance": [
    "Primary-source synthesis plus seven synthetic fixtures, not field reliability evidence. No third-party payload or source code redistributed.",
    "Reproduction: https://hesela.dev/research/gzip-read-coverage.py ; observations: https://hesela.dev/research/gzip-read-coverage.json . Python standard library only; caller-returned bytes, not physical I/O."
  ]
}
