-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(configuration): use literal newlines in multiline env vars
Docker, bash, etc. support multiline environment variables, by simply wrapping the value in single quotes with newlines, e.g. in an .env file: multi_line_value='first line second line third line' Resulting in the expected: $ echo "$multi_line_value" first line second line third line Due to a quirk in VS Code's Python extension, multiline values are not parsed, see https://code.visualstudio.com/docs/python/environments#_environment-variables > ... Multiline values aren't supported ... And more ongoing discussion at microsoft/vscode-python#18307 When running locally in e.g. Debug mode, and secrets are read dynamically from the environment, Python loses the multiline value and we end up with: >> value = os.environ.get("multi_line_value") >> print(value) first line This changes the samples so literal newlines are added to the value of the environment variable in an .env file: multi_line_value='first line\nsecond line\nthird line' So when Python reads it we get the actual newline: first line\nsecond line\nthird line
- Loading branch information
1 parent
3edb2ae
commit 29c84b6
Showing
2 changed files
with
35 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters