Is your feature request related to a problem? Please describe.
SevenZipFile does not support mode="x" which stands for "exclusive writing mode".
The official documentation for open() states open for exclusive creation, failing if the file already exists.
From my understanding:
w
x
open for writing
open for writing
create the file if it doesn't exist
create the file if it doesn't exist
Overwrite the file if it exists
raise FileExistsError if the file exists
Describe the solution you'd like
Considering that w and x are near identical, minimal code changes are required. In fact, seems to me py7zr already has code in place to handle it?
Is your feature request related to a problem? Please describe. SevenZipFile does not support
mode="x"
which stands for "exclusive writing mode".The official documentation for
open()
statesopen for exclusive creation, failing if the file already exists
.From my understanding:
Describe the solution you'd like Considering that
w
andx
are near identical, minimal code changes are required. In fact, seems to me py7zr already has code in place to handle it?https://github.com/miurahr/py7zr/blob/606b50ea2561601c59a1232b17dec43416f61bab/py7zr/py7zr.py#L360-L361 https://github.com/miurahr/py7zr/blob/606b50ea2561601c59a1232b17dec43416f61bab/py7zr/py7zr.py#L374-L375
But it fails here: https://github.com/miurahr/py7zr/blob/606b50ea2561601c59a1232b17dec43416f61bab/py7zr/py7zr.py#L343-L344
Describe alternatives you've considered Manually check for existing file before opening in
mode="w"
.Additional context N/A