Skip to content

Commit f5af167

Browse files
[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 3ac4e78) Co-authored-by: Julien Palard <[email protected]>
1 parent 1e4044c commit f5af167

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Doc/library/configparser.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ from ``get()`` calls.
323323
my_pictures: %(my_dir)s/Pictures
324324
325325
[Escape]
326-
gain: 80%% # use a %% to escape the % sign (% is the only character that needs to be escaped)
326+
# use a %% to escape the % sign (% is the only character that needs to be escaped):
327+
gain: 80%%
327328
328329
In the example above, :class:`ConfigParser` with *interpolation* set to
329330
``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of
@@ -358,7 +359,8 @@ from ``get()`` calls.
358359
my_pictures: ${my_dir}/Pictures
359360
360361
[Escape]
361-
cost: $$80 # use a $$ to escape the $ sign ($ is the only character that needs to be escaped)
362+
# use a $$ to escape the $ sign ($ is the only character that needs to be escaped):
363+
cost: $$80
362364
363365
Values from other sections can be fetched as well:
364366

0 commit comments

Comments
 (0)