From: Phillip Berndt Date: Thu, 1 Dec 2022 07:41:15 +0000 (+0100) Subject: Quote arguments in failed command output X-Git-Tag: 1.13~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a8dfbda0d4fdc4bf90d28a7947f478075738677e;hp=0dc563f5ab0d2102fb49605e0703a94e42f166b8;p=deb_pkgs%2Fautorandr.git Quote arguments in failed command output See #297 and #299 --- diff --git a/autorandr.py b/autorandr.py index 5541346..d9b853b 100755 --- a/autorandr.py +++ b/autorandr.py @@ -947,7 +947,7 @@ def apply_configuration(new_configuration, current_configuration, dry_run=False) if auxiliary_changes_pre: argv = base_argv + list(chain.from_iterable(auxiliary_changes_pre)) if call_and_retry(argv, dry_run=dry_run) != 0: - raise AutorandrException("Command failed: %s" % " ".join(argv)) + raise AutorandrException("Command failed: %s" % " ".join(map(shlex.quote, argv))) # Starting here, fix the frame buffer size # Do not do this earlier, as disabling scaling might temporarily make the framebuffer @@ -985,7 +985,7 @@ def apply_configuration(new_configuration, current_configuration, dry_run=False) for index in range(0, len(operations), 2): argv = base_argv + list(chain.from_iterable(operations[index:index + 2])) if call_and_retry(argv, dry_run=dry_run) != 0: - raise AutorandrException("Command failed: %s" % " ".join(argv)) + raise AutorandrException("Command failed: %s" % " ".join(map(shlex.quote, argv))) def is_equal_configuration(source_configuration, target_configuration):