From c254b4ad1d86745fc0389eea02ea687d48c4feee Mon Sep 17 00:00:00 2001 From: Witcher01 Date: Fri, 24 Jul 2020 14:42:27 +0200 Subject: [PATCH] fixed password.fetch option not using environment the '_strategy_command' in 'fetchparams.cli' did not expand the path of every argument, but only the first one (being the command to be executed). i fixed the '_strategy_command' function to apply the 'expand_path' function to every member of the commands list. --- AUTHORS.rst | 1 + vdirsyncer/cli/fetchparams.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 0083832..146245f 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -13,6 +13,7 @@ In alphabetical order: - Markus Unterwaditzer - Michael Adler - Thomas Weißschuh +- Witcher01 Special thanks goes to: diff --git a/vdirsyncer/cli/fetchparams.py b/vdirsyncer/cli/fetchparams.py index ff675a9..3d15119 100644 --- a/vdirsyncer/cli/fetchparams.py +++ b/vdirsyncer/cli/fetchparams.py @@ -77,7 +77,10 @@ def _fetch_value(opts, key): def _strategy_command(*command): import subprocess - command = (expand_path(command[0]),) + command[1:] + # normalize path of every path member + # if there is no path specified then nothing will happen + command = map(expand_path, command) + try: stdout = subprocess.check_output(command, universal_newlines=True) return stdout.strip("\n")