From 6b385abfef75d165de92b25be465afb03f126812 Mon Sep 17 00:00:00 2001 From: deeplow Date: Thu, 25 Aug 2022 08:56:32 +0100 Subject: [PATCH] fix regression: --output-filename fails --output-filename failed with the message: Safe PDF filename is not writable Bug introduced in commit 95ed346. --- dangerzone/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dangerzone/cli.py b/dangerzone/cli.py index 834499a..1718975 100644 --- a/dangerzone/cli.py +++ b/dangerzone/cli.py @@ -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(