Skip to content

Commit 89f6898

Browse files
SortBySpec: avoid triggering bandit security checker
Guess it was triggered due to naming the variable "token", maybe "sort_key" is less problematic.
1 parent f5b2ade commit 89f6898

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/borg/helpers/parseformat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,9 @@ def FilesystemPathSpec(text):
351351
def SortBySpec(text):
352352
from ..manifest import AI_HUMAN_SORT_KEYS
353353

354-
for token in text.split(","):
355-
if token not in AI_HUMAN_SORT_KEYS and token != "ts": # idempotency: do not reject ts
356-
raise argparse.ArgumentTypeError("Invalid sort key: %s" % token)
354+
for sort_key in text.split(","):
355+
if sort_key not in AI_HUMAN_SORT_KEYS and sort_key != "ts": # idempotency: do not reject ts
356+
raise argparse.ArgumentTypeError("Invalid sort key: %s" % sort_key)
357357
return text.replace("timestamp", "ts").replace("archive", "name")
358358

359359

0 commit comments

Comments
 (0)