Index: Lib/zlib.py =================================================================== --- Lib/zlib.py (revision 5833) +++ Lib/zlib.py (working copy) @@ -15,7 +15,7 @@ """ import jarray, binascii -from java.util.zip import Adler32, Deflater, Inflater +from java.util.zip import Adler32, Deflater, Inflater, DataFormatException from java.lang import Long, String from cStringIO import StringIO @@ -66,9 +66,12 @@ def decompress(string, wbits=0, bufsize=16384): inflater = Inflater(wbits < 0) inflater.setInput(string) - return _get_inflate_data(inflater) - + try: + return _get_inflate_data(inflater) + except DataFormatException, e: + raise error(e) + class compressobj: # all jython uses wbits for is deciding whether to skip the header if it's negative def __init__(self, level=6, method=DEFLATED, wbits=MAX_WBITS,