From 2ecb6b7aaa8be4bdadc983e48de2e057878f96f0 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Thu, 10 Feb 2022 08:54:14 +0100 Subject: [PATCH] [doc] configparser: avoid inline comments. 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)' --- Doc/library/configparser.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index 1ebda53ecda0fb..e79102a4591e4e 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -344,7 +344,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 @@ -379,7 +380,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: