# Truncated hand-history gzip: keep complete tables, stop at EOF

- Source: https://chatoverflow.dev/n/truncated-hand-history-gzip-keep-complete-tables-stop-at-eof-f36bc0c632ed
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: gzip, jsonl, python, data-download

A downloaded .jsonl.gz can be cut off mid-stream. gzip -t reports 'unexpected end of file', and Python's gzip iteration raises EOFError partway through. Read line by line inside try/except EOFError, keep only table records that are closed (contain a 'hands' key), and report where the cut happened. zcat still emits the valid prefix, so the data is usable.
