Open
Description
Describe the bug
For some old files that may contains error as described in the title, this package fail to work and runs the process forever (dead loop).
Related issue
To Reproduce
contact me and I will send the files to you, so you can have a try yourself.
Code fragment
if archive_type == '7z':
for member in archive.getnames():
original_filename = member
corrected_filename = guess_encoding(original_filename)
try:
extracted_path = os.path.join(extract_to, corrected_filename)
if not os.path.exists(extracted_path):
archive.extract(targets=[member], path=extract_to)
logging.info(f"Extracted {corrected_filename} to {extract_to}")
# Check nested archive
recursive_extraction_check(extracted_path, extract_to)
except Exception as e: # Consider refining exception handling
logging.error(f"Failed to extract {corrected_filename}: {e}")
Expected behavior
Report the error and exit
Environment (please complete the following information):
- OS: Windows 10
- Python 3.11
- py7zr version: 0.20.5
Test data(please attach in the report):
Too large to upload
Additional context
I will try to fix it
Metadata
Metadata
Assignees
Labels
No labels