Commit 77c81d7
committed
gh-156002: Keep reading through third-party zipfile decompressors
GH-156003 made ZipExtFile._read1() call decompress(data, max_length) on
non-deflate decompressors and consult needs_input before reading more. A
decompressor installed by replacing _get_decompressor() (zipfile-zstd,
zipfile-deflate64, ...) may support neither, and every read through it
then failed with AttributeError.
Give _decompressor_needs_input() a default for decompressors that report
nothing, and only take the bounded path for decompressors that do report
needs_input (the stdlib ones); others are read unbounded, as before.1 parent 024b6bc commit 77c81d7
3 files changed
Lines changed: 89 additions & 7 deletions
File tree
- Lib
- test/test_zipfile
- zipfile
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4916 | 4916 | | |
4917 | 4917 | | |
4918 | 4918 | | |
| 4919 | + | |
| 4920 | + | |
| 4921 | + | |
| 4922 | + | |
| 4923 | + | |
| 4924 | + | |
| 4925 | + | |
| 4926 | + | |
| 4927 | + | |
| 4928 | + | |
| 4929 | + | |
| 4930 | + | |
| 4931 | + | |
| 4932 | + | |
| 4933 | + | |
| 4934 | + | |
| 4935 | + | |
| 4936 | + | |
| 4937 | + | |
| 4938 | + | |
| 4939 | + | |
| 4940 | + | |
| 4941 | + | |
| 4942 | + | |
| 4943 | + | |
| 4944 | + | |
| 4945 | + | |
| 4946 | + | |
| 4947 | + | |
| 4948 | + | |
| 4949 | + | |
| 4950 | + | |
| 4951 | + | |
| 4952 | + | |
| 4953 | + | |
| 4954 | + | |
| 4955 | + | |
| 4956 | + | |
| 4957 | + | |
| 4958 | + | |
| 4959 | + | |
| 4960 | + | |
| 4961 | + | |
| 4962 | + | |
| 4963 | + | |
| 4964 | + | |
| 4965 | + | |
| 4966 | + | |
| 4967 | + | |
| 4968 | + | |
| 4969 | + | |
| 4970 | + | |
| 4971 | + | |
| 4972 | + | |
| 4973 | + | |
| 4974 | + | |
| 4975 | + | |
| 4976 | + | |
4919 | 4977 | | |
4920 | 4978 | | |
4921 | 4979 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
893 | 893 | | |
894 | 894 | | |
895 | 895 | | |
896 | | - | |
| 896 | + | |
897 | 897 | | |
898 | 898 | | |
| 899 | + | |
899 | 900 | | |
900 | | - | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
901 | 913 | | |
902 | 914 | | |
903 | 915 | | |
| |||
1007 | 1019 | | |
1008 | 1020 | | |
1009 | 1021 | | |
1010 | | - | |
| 1022 | + | |
1011 | 1023 | | |
1012 | 1024 | | |
1013 | 1025 | | |
| |||
1190 | 1202 | | |
1191 | 1203 | | |
1192 | 1204 | | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
1193 | 1209 | | |
1194 | 1210 | | |
1195 | 1211 | | |
| |||
1207 | 1223 | | |
1208 | 1224 | | |
1209 | 1225 | | |
1210 | | - | |
| 1226 | + | |
1211 | 1227 | | |
1212 | 1228 | | |
1213 | 1229 | | |
| |||
1222 | 1238 | | |
1223 | 1239 | | |
1224 | 1240 | | |
1225 | | - | |
| 1241 | + | |
1226 | 1242 | | |
1227 | 1243 | | |
1228 | 1244 | | |
1229 | 1245 | | |
1230 | 1246 | | |
1231 | 1247 | | |
1232 | | - | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1233 | 1252 | | |
1234 | 1253 | | |
1235 | 1254 | | |
| |||
1318 | 1337 | | |
1319 | 1338 | | |
1320 | 1339 | | |
1321 | | - | |
| 1340 | + | |
1322 | 1341 | | |
1323 | 1342 | | |
1324 | 1343 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments