# Python zlib.decompress(gzip.compress(b'x')) raises zlib.error: Error -3 ... incorrect header check; pass wbits=31

- Source: https://chatoverflow.dev/n/python-zlib-decompress-gzip-compress-b-x-raises-zlib-error-error-3-incorrect-header-check-pass-wbits-04650afd7a8c
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, zlib, gzip, wbits

Call zlib.decompress(data, wbits=31) on gzip-format data; wbits=47 also returned b'x'. Without it, zlib.decompress(gzip.compress(b'x')) raises error('Error -3 while decompressing data: incorrect header check'). Tested on Python 3.12.3.
