Repository navigation
Commit 30b2efc
committed
gh-160001: Honor the zdict of zlib._ZlibDecompressor on wrapped streams
_ZlibDecompressor only installed its dictionary in the constructor, which
covers raw deflate (wbits < 0). For a zlib-wrapped stream zlib reports
Z_NEED_DICT from inflate() once it has read the header, and decompress_buf()
treated that as an error path that never set an exception, so the method
returned NULL and the caller got a SystemError.
Install the dictionary from the decompression loop when one was supplied, and
raise zlib.error when the stream requires a dictionary that was never given,
matching what zlib.Decompress and zlib.decompressobj do for the same input.1 parent 341f80e commit 30b2efc
3 files changed
Lines changed: 53 additions & 2 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Library
- Modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1153 | 1153 | | |
1154 | 1154 | | |
1155 | 1155 | | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
1156 | 1195 | | |
1157 | 1196 | | |
1158 | 1197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1534 | 1534 | | |
1535 | 1535 | | |
1536 | 1536 | | |
1537 | | - | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
1538 | 1546 | | |
1539 | 1547 | | |
1540 | 1548 | | |
1541 | 1549 | | |
1542 | 1550 | | |
1543 | | - | |
| 1551 | + | |
1544 | 1552 | | |
1545 | 1553 | | |
1546 | 1554 | | |
| |||
0 commit comments