# HG changeset patch # User Henry S. Thompson # Date 1773254541 0 # Node ID a8a5f07211c418701cb935ff78908476502a16a1 # Parent ceacc13bf0e71d006d63c73378f6f45188a85690 Now using isal_zlib.decompressobj diff -r ceacc13bf0e7 -r a8a5f07211c4 lib/python/cc/warc.py --- a/lib/python/cc/warc.py Wed Mar 11 18:20:05 2026 +0000 +++ b/lib/python/cc/warc.py Wed Mar 11 18:42:21 2026 +0000 @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# cython: profile=False, language_level=3str '''Stream a warc format file, unzipping if necessary, invoking a callback on each record. Callback can be limited by WARC-Type, record part''' @@ -166,8 +167,8 @@ if gzip._read_gzip_header(fp) is None: return (b"",0) bp=fp.tell() - # Use a zlib raw deflate compressor - do = zlib.decompressobj(wbits=-zlib.MAX_WBITS) + # Use a isal's zlib raw deflate compressor + do = isal_zlib.decompressobj(wbits=-zlib.MAX_WBITS) # Read all the data except the header decompressed = do.decompress(data[bp:]) if not do.eof or (uu:=len(do.unused_data)) < 8: @@ -177,14 +178,14 @@ crc, length = struct.unpack("