-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Python env file variable substitution: fix errors #4888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Some of the information about variable substitution in Python environment files was incorrect as written, as evidenced by the unit tests (see [here][test1] and [here][test2]). This commit replaces that information with language that describes the behavior of the code (see [here][code1] and [here][code2]) accurately. [test1]: https://github.com/microsoft/vscode-python/blob/94a6ba89c295145407388fdc0744e34314b2a325/src/test/common/variables/envVarsService.unit.test.ts#L409-L437 [test2]: https://github.com/microsoft/vscode-python/blob/94a6ba89c295145407388fdc0744e34314b2a325/src/test/common/variables/envVarsService.unit.test.ts#L500-L516 [code1]: https://github.com/microsoft/vscode-python/blob/94a6ba89c295145407388fdc0744e34314b2a325/src/client/common/variables/environment.ts#L121-L127 [code2]: https://github.com/microsoft/vscode-python/blob/94a6ba89c295145407388fdc0744e34314b2a325/src/client/common/variables/environment.ts#L135-L164
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 "${...}").
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 "${...}").
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 "${...}").
|
OK, actually something's odd here... the part about |
|
Thanks for keeping us in the loop @kini! Please let us know if there are any more issues. |
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 "${...}").
…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 "${...}").
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.