File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 77
88# Raw DEFLATE bitstream
99buf = io .BytesIO (b'\xcb H\xcd \xc9 \xc9 \x07 \x00 ' )
10- inp = zlib .DecompIO (buf )
10+ inp = zlib .DecompIO (buf , - 8 )
1111print (buf .seek (0 , 1 ))
1212print (inp .read (1 ))
1313print (buf .seek (0 , 1 ))
1717print (inp .read (1 ))
1818print (inp .read ())
1919print (buf .seek (0 , 1 ))
20+
21+
22+ # zlib bitstream
23+ inp = zlib .DecompIO (io .BytesIO (b'x\x9c 30\xa0 =\x00 \x00 \xb3 q\x12 \xc1 ' ))
24+ print (inp .read (10 ))
25+ print (inp .read ())
26+
27+ # zlib bitstream, wrong checksum
28+ inp = zlib .DecompIO (io .BytesIO (b'x\x9c 30\xa0 =\x00 \x00 \xb3 q\x12 \xc0 ' ))
29+ try :
30+ print (inp .read ())
31+ except OSError as e :
32+ print (repr (e ))
Original file line number Diff line number Diff line change 77b''
88b''
997
10+ b'0000000000'
11+ b'000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
12+ OSError(22,)
You can’t perform that action at this time.
0 commit comments