py7zr
py7zr copied to clipboard
pack_7zarchive doesn't cd into root_dir and doesn't abide dry_run
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:
- py7zr doesn't seem to cd into
root_dir
. I have to providebase_dir=outdbfp
otherwise it will way that the file does not exist. -
dry_run=True
seems to be ignored, as py7zr starts right away
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
Py7zr core does not have a feature of dry_run, so pack_7zarchive cannot support dry_run.
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
Same issue also on unpack_7zarchive