[Python-checkins] [doc] configparser: avoid inline comments. (GH-31247)
miss-islington
webhook-mailer at python.org
Wed Mar 23 05:01:30 EDT 2022
https://github.com/python/cpython/commit/f5af1677c06bb4cc006e7f9b30106212e1a00f81
commit: f5af1677c06bb4cc006e7f9b30106212e1a00f81
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022年03月23日T02:01:24-07:00
summary:
[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 at palard.fr>
files:
M Doc/library/configparser.rst
diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst
index e5c78246881f1..c98ffe718e50a 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:
More information about the Python-checkins
mailing list