Skip to content

Commit

Permalink
ut.update_template_file(): fix IndexError due to special character …
Browse files Browse the repository at this point in the history
…`+` (#1326)

* fix IndexError due to special character '+'
  • Loading branch information
MarritL authored Feb 28, 2025
1 parent ddc1357 commit aafeb9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mintpy/utils/utils1.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ def update_template_file(template_file, extra_dict, delimiter='='):
# link: https://docs.python.org/3/library/re.html
value2search = value
# 1. interpret special symbols as characters
for symbol in ['*', '[', ']', '(', ')']:
for symbol in ['*', '[', ']', '(', ')', '+']:
value2search = value2search.replace(symbol, fr"\{symbol}")
# 2. use "= {OLD_VALUE}" for search/replace to be more robust
# against the scenario when key name contains {OLD_VALUE}
Expand Down

0 comments on commit aafeb9d

Please sign in to comment.