fix regression: --output-filename fails

--output-filename failed with the message:

   Safe PDF filename is not writable

Bug introduced in commit 95ed346.
This commit is contained in:
deeplow 2022-08-25 08:56:32 +01:00
parent 83e6b0475f
commit 6b385abfef
No known key found for this signature in database
GPG key ID: 577982871529A52A

View file

@ -52,7 +52,7 @@ def cli_main(
return
try:
with open(os.path.abspath(output_filename), "rb") as f:
with open(os.path.abspath(output_filename), "wb"):
pass
except:
valid = False
@ -68,7 +68,7 @@ def cli_main(
f"{os.path.splitext(common.input_filename)[0]}-safe.pdf"
)
try:
with open(common.output_filename, "rb") as f:
with open(common.output_filename, "wb"):
pass
except:
click.echo(