py7zr icon indicating copy to clipboard operation
py7zr copied to clipboard

when append a directory to package 7z , some file raise Error

Open SUNKANGhui opened this issue 3 years ago • 5 comments

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)

  1. writing one file to to a SevenZipFile named demo.7z
  2. add one directory or more directories to demo.7z
  3. 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")
  1. 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.

SUNKANGhui avatar Jan 11 '22 06:01 SUNKANGhui

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.

miurahr avatar Jan 11 '22 10:01 miurahr

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

github-actions[bot] avatar Apr 19 '22 00:04 github-actions[bot]

when analyzing header after adding directory before close, I found empty list and file list is not consistent image

EmptyFiles should be [False, True, False, False, ...] and length should be 8

miurahr avatar Aug 03 '22 06:08 miurahr

Changed the behavior finding above, and add more expectations for assertion.

https://github.com/miurahr/py7zr/pull/475/files

Any other wrong point?

miurahr avatar Aug 08 '22 23:08 miurahr

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

github-actions[bot] avatar Nov 07 '22 00:11 github-actions[bot]