summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-03-23 02:01:24 -0700
committerGitHub <noreply@github.com>2022-03-23 02:01:24 -0700
commitf5af1677c06bb4cc006e7f9b30106212e1a00f81 (patch)
treef74a2433d276fdf24c1618894bb8693bedcbfd77
parentFix typo in Path.iterdir docs (GH-31822) (diff)
downloadcpython-f5af1677c06bb4cc006e7f9b30106212e1a00f81.tar.gz
cpython-f5af1677c06bb4cc006e7f9b30106212e1a00f81.tar.bz2
cpython-f5af1677c06bb4cc006e7f9b30106212e1a00f81.zip
[doc] configparser: avoid inline comments. (GH-31247)
People are testing those blocs with the default inline_comment_prefixes of None, leading to a: configparser.InterpolationSyntaxError: '$' must be followed by '$' or '{', found: '$ sign ($ is the only character that needs to be escaped)' (cherry picked from commit 3ac4e783e077ffd7b51c6acc1591002974644051) Co-authored-by: Julien Palard <julien@palard.fr>
-rw-r--r--Doc/library/configparser.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst
index e5c78246881..c98ffe718e5 100644
--- a/Doc/library/configparser.rst
+++ b/Doc/library/configparser.rst
@@ -323,7 +323,8 @@ from ``get()`` calls.
my_pictures: %(my_dir)s/Pictures
[Escape]
- gain: 80%% # use a %% to escape the % sign (% is the only character that needs to be escaped)
+ # use a %% to escape the % sign (% is the only character that needs to be escaped):
+ gain: 80%%
In the example above, :class:`ConfigParser` with *interpolation* set to
``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of
@@ -358,7 +359,8 @@ from ``get()`` calls.
my_pictures: ${my_dir}/Pictures
[Escape]
- cost: $$80 # use a $$ to escape the $ sign ($ is the only character that needs to be escaped)
+ # use a $$ to escape the $ sign ($ is the only character that needs to be escaped):
+ cost: $$80
Values from other sections can be fetched as well: