Skip to content

Commit 65d404e

Browse files
authored
Gh issue 3456 update environment variable documentation (#3482)
* Fix typos * Fix docs for retrieving missing environment variable. Fixes #3456
1 parent 28212ab commit 65d404e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/changelog/3456.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updates the documentation for ``os.environ['KEY']`` when the variable does not exist - by :user:`jugmac00`.

docs/config.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,8 @@ If you specify a substitution string like this::
16351635

16361636
{env:KEY}
16371637

1638-
then the value will be retrieved as ``os.environ['KEY']`` and raise an Error if the environment variable does not exist.
1638+
then the value will be retrieved as ``os.environ['KEY']`` and replaced with an empty string if the environment variable
1639+
does not exist.
16391640

16401641

16411642
Environment variable substitutions with default values
@@ -1645,14 +1646,14 @@ If you specify a substitution string like this::
16451646

16461647
{env:KEY:DEFAULTVALUE}
16471648

1648-
then the value will be retrieved as ``os.environ['KEY']`` and replace with DEFAULTVALUE if the environment variable does
1649+
then the value will be retrieved as ``os.environ['KEY']`` and replaced with DEFAULTVALUE if the environment variable does
16491650
not exist.
16501651

16511652
If you specify a substitution string like this::
16521653

16531654
{env:KEY:}
16541655

1655-
then the value will be retrieved as ``os.environ['KEY']`` and replace with an empty string if the environment variable
1656+
then the value will be retrieved as ``os.environ['KEY']`` and replaced with an empty string if the environment variable
16561657
does not exist.
16571658

16581659
Substitutions can also be nested. In that case they are expanded starting from the innermost expression::

0 commit comments

Comments
 (0)