diff --git a/src/borg/helpers/parseformat.py b/src/borg/helpers/parseformat.py index c4e7133d4..87b4b731e 100644 --- a/src/borg/helpers/parseformat.py +++ b/src/borg/helpers/parseformat.py @@ -351,9 +351,9 @@ def FilesystemPathSpec(text): def SortBySpec(text): from ..manifest import AI_HUMAN_SORT_KEYS - for token in text.split(","): - if token not in AI_HUMAN_SORT_KEYS and token != "ts": # idempotency: do not reject ts - raise argparse.ArgumentTypeError("Invalid sort key: %s" % token) + for sort_key in text.split(","): + if sort_key not in AI_HUMAN_SORT_KEYS and sort_key != "ts": # idempotency: do not reject ts + raise argparse.ArgumentTypeError("Invalid sort key: %s" % sort_key) return text.replace("timestamp", "ts").replace("archive", "name")