Skip to content

Conversation

@kini
Copy link

@kini kini commented Oct 15, 2021

Some of the information about variable substitution in Python
environment files was incorrect as written, as evidenced by the unit
tests (see here and here). This commit replaces
that information with language that describes the behavior of the
code (see here and here) accurately.

@ghost
Copy link

ghost commented Oct 15, 2021

CLA assistant check
All CLA requirements met.

kini added a commit to kini/vscode-python that referenced this pull request Oct 15, 2021
The behavior of interpreting "\n" inside quoted strings in env files
was neither documented nor tested, so this commit modifies the unit
tests to pin down that behavior.

I also added a test for the example I'm proposing to add to the docs
in PR microsoft/vscode-docs#4888.

I also extended the test for escaping "$" to show that it works even
when the "$" isn't part of something that matches
SUBST_REGEX (i.e. isn't the beginning of something looking like
"${...}").
kini added a commit to kini/vscode-python that referenced this pull request Oct 15, 2021
The behavior of interpreting "\n" inside quoted strings in env files
was neither documented nor tested, so this commit modifies the unit
tests to pin down that behavior.

I also added a test for the example I'm proposing to add to the docs
in PR microsoft/vscode-docs#4888.

I also extended the test for escaping "$" to show that it works even
when the "$" isn't part of something that matches
SUBST_REGEX (i.e. isn't the beginning of something looking like
"${...}").
kini added a commit to kini/vscode-python that referenced this pull request Oct 15, 2021
The behavior of interpreting "\n" inside quoted strings in env files
was neither documented nor tested, so this commit modifies the unit
tests to pin down that behavior.

I also added a test for the example I'm proposing to add to the docs
in PR microsoft/vscode-docs#4888.

I also extended the test for escaping "$" to show that it works even
when the "$" isn't part of something that matches
SUBST_REGEX (i.e. isn't the beginning of something looking like
"${...}").
@kini
Copy link
Author

kini commented Oct 15, 2021

OK, actually something's odd here... the part about env: doesn't quite gel with #3856, so I must be missing something. I'm guessing the real behavior is that ${env:FOO} refers to environment variables present in the process's environment, whereas ${FOO} refers to environment variables previously defined in the env file being processed (what's called "recursive" substitution in the docs and the test suite), in which case some examples in the docs would need to be of one form and some of the other. I'll look into this more a bit later, sorry for the noise.

@rjmolyneaux
Copy link
Contributor

Thanks for keeping us in the loop @kini! Please let us know if there are any more issues.

karrtikr pushed a commit to microsoft/vscode-python that referenced this pull request Jan 18, 2022
The behavior of interpreting "\n" inside quoted strings in env files
was neither documented nor tested, so this commit modifies the unit
tests to pin down that behavior.

I also added a test for the example I'm proposing to add to the docs
in PR microsoft/vscode-docs#4888.

I also extended the test for escaping "$" to show that it works even
when the "$" isn't part of something that matches
SUBST_REGEX (i.e. isn't the beginning of something looking like
"${...}").
wesm pushed a commit to posit-dev/positron that referenced this pull request Mar 28, 2024
…vscode-python#17747)

The behavior of interpreting "\n" inside quoted strings in env files
was neither documented nor tested, so this commit modifies the unit
tests to pin down that behavior.

I also added a test for the example I'm proposing to add to the docs
in PR microsoft/vscode-docs#4888.

I also extended the test for escaping "$" to show that it works even
when the "$" isn't part of something that matches
SUBST_REGEX (i.e. isn't the beginning of something looking like
"${...}").
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants