Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SUNKANGhui opened this issue Jan 11, 2022 · 5 comments
Open

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

SUNKANGhui opened this issue Jan 11, 2022 · 5 comments
Assignees
Labels
bug Something isn't working for archiving Issue on archiving, compression or encryption

Comments

@SUNKANGhui
Copy link

SUNKANGhui commented Jan 11, 2022

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.

@miurahr miurahr added the invalid This doesn't seem right label Jan 11, 2022
@miurahr
Copy link
Owner

miurahr commented Jan 11, 2022

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 miurahr added needs more info Need more information or test data to reproduce and removed invalid This doesn't seem right labels Jan 11, 2022
@miurahr miurahr removed the needs more info Need more information or test data to reproduce label Jan 18, 2022
@github-actions
Copy link

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

@miurahr miurahr added the for archiving Issue on archiving, compression or encryption label Jul 2, 2022
@miurahr
Copy link
Owner

miurahr commented Aug 3, 2022

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 miurahr self-assigned this Aug 3, 2022
@miurahr miurahr added the bug Something isn't working label Aug 3, 2022
@miurahr
Copy link
Owner

miurahr commented Aug 8, 2022

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

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

Any other wrong point?

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working for archiving Issue on archiving, compression or encryption
Projects
None yet
Development

No branches or pull requests

2 participants