Commit graph

127270 commits

Author SHA1 Message Date
Danny Lin
11c09378b2 Revise NEWS 2025-06-20 15:54:38 +08:00
Danny Lin
5f093e5175 Sync with danny0838/zipremove@1691ca25bf 2025-06-20 15:34:58 +08:00
Danny Lin
ce886161f1 Update NEWS 2025-06-20 15:10:44 +08:00
Danny Lin
1ece5b17d5 Refactor and optimize RepackHelperMixin 2025-06-14 13:55:20 +08:00
Danny Lin
c759b639ee Improve dependency check for decompression tests 2025-06-14 13:48:41 +08:00
Danny Lin
0f50a6f561 Remove unneeded variables 2025-06-14 13:48:35 +08:00
Danny Lin
cb549c95f1 Patch more explicitly 2025-06-14 13:48:28 +08:00
Danny Lin
3b2f2328b6 Remove unneeded catch type
- NotImplementedError is a subclass of RuntimeError.
2025-06-14 13:48:21 +08:00
Danny Lin
797a62cd8f Fix and optimize repack 2025-06-01 17:50:28 +08:00
Danny Lin
04cddef2f7 Remove unneeded import 2025-06-01 15:57:16 +08:00
Danny Lin
b1dcb07f33 Test with pre-calculated CRC 2025-06-01 15:54:37 +08:00
Danny Lin
c470c33389 Fix _scan_data_descriptor_no_sig_by_decompression when library not available 2025-06-01 15:48:01 +08:00
Danny Lin
578c7c8b6a Add requirements 2025-06-01 15:42:07 +08:00
Danny Lin
aaa566c94c Remove unneeded import 2025-06-01 15:21:55 +08:00
Danny Lin
db9d0d6199 Add tests for _ZipRepacker 2025-06-01 15:12:23 +08:00
Danny Lin
1d5ec61337 Fix _scan_data_descriptor_no_sig_by_decompression 2025-06-01 15:11:33 +08:00
Danny Lin
b5d7ae3a6a Rename _trace_compressed_block_end 2025-06-01 14:59:29 +08:00
Danny Lin
92d3a9c418 Fix and optimize _scan_data_descriptor_no_sig 2025-06-01 14:12:03 +08:00
Danny Lin
8067b0c489 Fix _scan_data_descriptor 2025-06-01 14:11:57 +08:00
Danny Lin
fef92c45a3 Fix and optimize _iter_scan_signature 2025-06-01 14:11:51 +08:00
Danny Lin
ea3259fba7 Optimize code 2025-06-01 14:11:43 +08:00
Danny Lin
de4f15bb4a Fix rst 2025-05-30 22:49:14 +08:00
Danny Lin
2b23d46d95 Add memory usage test 2025-05-30 22:42:11 +08:00
Danny Lin
e1caea9b30 Adjust method names 2025-05-30 20:59:52 +08:00
Danny Lin
c80d21bf99 Strip only entries immediately following a referenced entry
- The previous implementation might cause [archive decryption header] and/or [archive extra data record] preceeding [central directory] be stripped.
2025-05-30 20:57:36 +08:00
Danny Lin
f8fade17a0 Introduce _scan_data_descriptor_no_sig_by_decompression 2025-05-30 20:56:31 +08:00
Danny Lin
31c4c936c6 Rework _validate_local_file_entry_sequence to allow passing no checked_offsets 2025-05-30 13:59:53 +08:00
Danny Lin
3d0240c1a3 Rework _validate_local_file_entry_sequence to return size or None 2025-05-30 13:59:53 +08:00
Danny Lin
a05353c476 Improve debug for _ZipRepacker.repack() 2025-05-30 13:59:52 +08:00
Danny Lin
c62a4556ff Optimize code and revise comment
- According to ZIP spec, both uncompressed and compressed size should be 0xffffffff when zip64 is used.
2025-05-29 10:46:11 +08:00
Danny Lin
81a419aaf7 Adjust parameter order 2025-05-29 10:46:11 +08:00
Danny Lin
fbf75888fc Rename methods and parameters 2025-05-28 11:46:48 +08:00
Danny Lin
3ef72c68be Add tearDown for tests 2025-05-28 11:45:47 +08:00
Danny Lin
9e94209e94 Revise docstring 2025-05-27 08:27:17 +08:00
Danny Lin
93f4c25d39 Fix bad test code 2025-05-27 07:57:28 +08:00
Danny Lin
e76f9a1bc1 Fix bytes between entries be removed when removed is passed 2025-05-27 00:20:40 +08:00
Danny Lin
926338cbc1 Support repack(removed) 2025-05-26 23:46:17 +08:00
Danny Lin
4c35eb262d Check testzip() after zip file closed 2025-05-26 23:00:08 +08:00
Danny Lin
8a448e452b Add test for bytes between file entries 2025-05-26 22:45:20 +08:00
Danny Lin
95fde316ab Fix typo 2025-05-26 22:43:58 +08:00
Danny Lin
555ac78aec Update doc 2025-05-26 01:06:56 +08:00
Danny Lin
edee2033c4 Rework writing protection
- Set `_writing` to prevent `open('w').write()` during repacking.
- Move the protection logic to `ZipFile.repack()`.
2025-05-25 22:09:29 +08:00
Danny Lin
ae01b8cd69 Raise on overlapping file blocks 2025-05-25 21:09:12 +08:00
Danny Lin
a788a001a4 Use zinfo rather than info 2025-05-25 21:08:49 +08:00
Danny Lin
0cb8682dfa Remove obsolete NameToInfo updating 2025-05-25 21:07:52 +08:00
Danny Lin
8f0a504b20 Fix and improve validation tests
- Separate individual validation tests.
- Check underlying repacker not called in validation.
- Use `unlink` to prevent FileNotFoundError.
- Fix mode 'x' test.
2025-05-25 16:18:56 +08:00
Danny Lin
0d971d81b5 Add strict_descriptor option 2025-05-25 10:19:06 +08:00
Danny Lin
51c9254cfb Refactor _validate_local_file_entry 2025-05-25 10:09:49 +08:00
Danny Lin
1b7d75a4ea Introduce _move_entry_data and rework chunk_size passing 2025-05-25 10:09:41 +08:00
Danny Lin
c3c834505f Introduce _debug and refactor 2025-05-25 10:09:33 +08:00