Skip to content

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

Open
@raffaem

Description

@raffaem

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfor archivingIssue on archiving, compression or encryptiongood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions