Fix regression with multiple env substitutions for the same key #2873
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix regression introduced in 4.3.0 which occured when a substitution expression for an environment variable that had previously been substituted appears in the ini file after a substitution expression for a different environment variable.
This situation erroneously resulted in an exception about "circular chain between set" of those variables.
Before the substitution parser rewrite, args was being copied in the
replace
function:tox/src/tox/config/loader/ini/replace.py
Line 35 in 955a7fb
This patch restores the previous behavior by copying
conf_args
at the beginning of_replace_match
.This change also preserves recursive chain detection logic by passing the copied
conf_args
back intoreplace
when recursively expanding a previous replacement so that any values saved in the chain during the previous replace are present for the recursive replace (test case added in previous commit).Fix #2869
Thanks for contribution
Please, make sure you address all the checklists (for details on how see
development documentation)!
tox -e fix
)docs/changelog
folder