Commit 82d68c7
committed
gh-154842: Reject repack() while a reading handle is open
ZipFile.repack() moves member data, but a ZipExtFile from an earlier open()
keeps its own absolute position, so it silently returned data from the wrong
place and a full read failed with a misleading CRC error. Raise ValueError
while _fileRefCnt shows an open reading handle, as the writing-handle case
already does.1 parent 8b048eb commit 82d68c7
3 files changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
584 | | - | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
585 | 587 | | |
586 | 588 | | |
587 | 589 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2382 | 2382 | | |
2383 | 2383 | | |
2384 | 2384 | | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
2385 | 2397 | | |
2386 | 2398 | | |
2387 | 2399 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2404 | 2404 | | |
2405 | 2405 | | |
2406 | 2406 | | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
2407 | 2412 | | |
2408 | 2413 | | |
2409 | 2414 | | |
| |||
0 commit comments