You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I change the passed environment to the second call to env["FAKE_PATH"] = "_wombat"
the output is appears correct: _wombat/mongoose
the leading "/" in the existing FAKE_PATH variable appears to be one problem, although of course the problem with the first variant must be something else. I'm guessing the parser can't handle this otherwise bash-acceptable syntax with an expansion inside an ":+" expansion like this? I didn't see anything quite like it in the test cases. I know the docs warn "All the standard shell expansions are supported, including some level of nested expansion, as long as this is not too complex or ambiguous", but it is unfortunate that this syntax fails.
The text was updated successfully, but these errors were encountered:
I was probably testing the example with a Windows path that uses \ backslashes, and the r"" was left from that - raw strings are handy for that to avoid doubling the backslashes to escape them.
The following example of parameter expansion within another expansion works in bash (Ubuntu and MacOS, also zsh on the latter):
The intent is to only append the ";" character if "FAKE_BATH" is already set, to avoid getting ";/mongoose" when it isn't. The result is as expected:
But Python (3.9) code that should be the equivalent for parameter_expansion:
fails, and produces:
If I change the passed environment to the second call to
env["FAKE_PATH"] = "_wombat"
the output is appears correct:
_wombat/mongoose
the leading "/" in the existing FAKE_PATH variable appears to be one problem, although of course the problem with the first variant must be something else. I'm guessing the parser can't handle this otherwise bash-acceptable syntax with an expansion inside an ":+" expansion like this? I didn't see anything quite like it in the test cases. I know the docs warn "All the standard shell expansions are supported, including some level of nested expansion, as long as this is not too complex or ambiguous", but it is unfortunate that this syntax fails.
The text was updated successfully, but these errors were encountered: