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

pack_7zarchive doesn't cd into root_dir and doesn't abide dry_run #413

Open
raffaem opened this issue Feb 7, 2022 · 4 comments
Open

pack_7zarchive doesn't cd into root_dir and doesn't abide dry_run #413

raffaem opened this issue Feb 7, 2022 · 4 comments
Labels
bug Something isn't working for archiving Issue on archiving, compression or encryption good first issue Good for newcomers help wanted Extra attention is needed

Comments

@raffaem
Copy link

raffaem commented Feb 7, 2022

I'm using the following code.

outdbfp is a pathlib.WindowsPath of the file I want to compress. Its value is of the form MYPATH\db.sqlite3.

outdbzip is a pathlib.WindowsPath of the output file I want. Its value is of the form MYPATH\db.7z.

Notice the two files are on the same directory.

shutil.register_archive_format('7zip', py7zr.pack_7zarchive, description='7zip archive')
shutil.make_archive (
    outdbzip.stem,
    '7zip',
    root_dir=outdbzip.parent,
    base_dir=outdbfp.name,
    logger=logging.getLogger(),
    dry_run=True
)

However there are 2 problems:

  1. py7zr doesn't seem to cd into root_dir. I have to provide base_dir=outdbfp otherwise it will way that the file does not exist.
  2. dry_run=True seems to be ignored, as py7zr starts right away
@miurahr miurahr added the bug Something isn't working label Mar 7, 2022
@miurahr miurahr self-assigned this Mar 7, 2022
@miurahr miurahr added help wanted Extra attention is needed good first issue Good for newcomers for archiving Issue on archiving, compression or encryption labels Apr 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 removed their assignment Jul 18, 2022
@miurahr
Copy link
Owner

miurahr commented Jul 18, 2022

Py7zr core does not have a feature of dry_run, so pack_7zarchive cannot support dry_run.

@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
Copy link
Owner

miurahr commented Oct 18, 2022

Same issue also on unpack_7zarchive

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 good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants