Fix argument parsing to avoid using Python 3.12+ string features (#1057).

This commit is contained in:
Dan Helfman
2025-04-06 15:20:29 -07:00
parent 66a636e994
commit 3cd5c1290d
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -1,3 +1,7 @@
2.0.1
* #1057: Fix argument parsing to avoid using Python 3.12+ string features. Now borgmatic will
work with Python 3.9, 3.10, and 3.11 again.
2.0.0
* TL;DR: More flexible, completely revamped command hooks. All configuration options settable on
the command-line. New configuration options for many command-line flags (including verbosity!).
+1 -1
View File
@@ -357,7 +357,7 @@ def add_array_element_arguments(arguments_group, unparsed_arguments, flag_name):
if '[0]' not in flag_name or not unparsed_arguments or '--help' in unparsed_arguments:
return
pattern = re.compile(fr'^--{flag_name.replace("[0]", r"\[\d+\]").replace(".", r"\.")}$')
pattern = re.compile('^--' + flag_name.replace('[0]', r'\[\d+\]').replace('.', r'\.') + '$')
try:
# Find an existing list index flag (and its action) corresponding to the given flag name.