New submission from Vladimir Mihailenco: Consider following code:
``` import zlib hello = b'hello' # Compress data using deflate and shared/predefined dict. co = zlib.compressobj(wbits=-zlib.MAX_WBITS, zdict=hello) data = co.compress(hello) + co.flush() # Decompress deflate by providing same dict. do = zlib.decompressobj(wbits=-zlib.MAX_WBITS, zdict=hello) data = do.decompress(data) print(data) ``` Decompression fails with "zlib.error: Error -3 while decompressing data: invalid distance too far back". My original task was to decompress data I get from Golang library - https://golang.org/pkg/compress/flate/#NewWriterDict ---------- components: Library (Lib) messages: 266747 nosy: Vladimir Mihailenco priority: normal severity: normal status: open title: zlib can't decompress DEFLATE using shared dictionary type: behavior versions: Python 3.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27164> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com