Skip to content

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

Open
@SUNKANGhui

Description

@SUNKANGhui

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfor archivingIssue on archiving, compression or encryption

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions