py7zr
py7zr copied to clipboard
when append a directory to package 7z , some file raise Error
Describe the bug if adding one directory to a SevenZipFile, some files format like ".csv" or ".tiff"files in the directory is damaged. but if writing a SevenzipFile with the directory , files written successfully, no problem to open Related issue (if exist)
To Reproduce Steps to reproduce the behavior: (example)
- writing one file to to a SevenZipFile named demo.7z
- add one directory or more directories to demo.7z
- code:
import py7zr
out_file = r"D:/test/tmp/test/a/demo.7z"
with py7zr.SevenZipFile(out_file, 'w', password=None) as z:
z.write(r"D:/test/tmp/test/a.xlsx", arcname="a.xlsx")
with py7zr.SevenZipFile(out_file, 'a', password=None) as z:
z.writeall(r"D:/test/tmp/tmp/22", arcname="22")
- res program run success , but some files like "a.csv" can not open. raise Error:Unknown format or incorrect password but if writing the directory ,file open successfully
Expected behavior
expect: it can work well as mode"w"
Environment (please complete the following information):
- OS: OS: Windows 10, 64-bit
- Python 3.7.0
- py7zr version: 0.17.2
Test data(please attach in the report): source file here demo.zip
Additional context Add any other context about the problem here.
There is no description , environmental conditions.
Describe the bug A clear and concise description of what the bug is.
Please remove guidance sentence, and describe the bug clear and attach file when necessary to reproduce.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
when analyzing header after adding directory before close, I found empty list and file list is not consistent
EmptyFiles should be [False, True, False, False, ...] and length should be 8
Changed the behavior finding above, and add more expectations for assertion.
https://github.com/miurahr/py7zr/pull/475/files
Any other wrong point?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days