Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-21018: document how to escape characters in configparser #6137

Merged
merged 1 commit into from Sep 10, 2019
Merged

bpo-21018: document how to escape characters in configparser #6137

merged 1 commit into from Sep 10, 2019

Conversation

arunpersaud
Copy link
Contributor

@arunpersaud arunpersaud commented Mar 17, 2018

Document how $ and % can be escaped in configparser.

https://bugs.python.org/issue21018

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

Copy link
Contributor

@csabella csabella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I built the docs and these changes LGTM. @ambv or @berkerpeksag, would you be able to approve and merge? Thanks!

Copy link
Member

@berkerpeksag berkerpeksag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd still prefer only adding examples to the "Interpolation of values" section at https://docs.python.org/3/library/configparser.html#interpolation-of-values There is no need to explicitly document the escape characters. IMO, adding examples with a short comment would be better.

For example:

[Settings]
frequency: %%80

(I'm open to use more meaningful and close to real world examples :))

@arunpersaud
Copy link
Contributor Author

The problem with just an example for me is that it is not clear which characters one needs to escape and which not, being explicit about it seems better to me. But I'm open to whatever you guys prefer. If it is just an example I would suggest to add a comment

[Settings]
phase: 80%%  # use a %% to escape the % sign (% is the only character that needs to be escaped)

[Settings]
cost: $$80  # use a $$ to escape the $ sign ($ is the only character that needs to be escaped)

@berkerpeksag
Copy link
Member

Your suggested example is much better than mine.

@arunpersaud
Copy link
Contributor Author

Let me know what you want me to do... Should I change this pull request, create a new one, if so, do I need to rebase or can I just amend my request?

@matrixise matrixise added the docs Documentation in the Doc dir label May 15, 2019
@berkerpeksag
Copy link
Member

@arunpersaud yes, please update the PR. Rebasing your branch would be good, but not required unless it has merge conflicts.

…configparser

Document how $ and % can be escaped in configparser.
@arunpersaud
Copy link
Contributor Author

Updated my branch. Let me know if this is OK or if other changes are needed.

@JulienPalard JulienPalard merged commit 9a94093 into python:master Sep 10, 2019
@miss-islington
Copy link
Contributor

Thanks @arunpersaud for the PR, and @JulienPalard for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 10, 2019
…configparser (pythonGH-6137)

Document how $ and % can be escaped in configparser.
(cherry picked from commit 9a94093)

Co-authored-by: Arun Persaud <arun@nubati.net>
@bedevere-bot
Copy link

GH-15845 is a backport of this pull request to the 3.7 branch.

@JulienPalard
Copy link
Member

Thanks @arunpersaud for this PR!

@JulienPalard JulienPalard added the needs backport to 3.8 only security fixes label Sep 10, 2019
@miss-islington
Copy link
Contributor

Thanks @arunpersaud for the PR, and @JulienPalard for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 10, 2019
…configparser (pythonGH-6137)

Document how $ and % can be escaped in configparser.
(cherry picked from commit 9a94093)

Co-authored-by: Arun Persaud <arun@nubati.net>
@bedevere-bot
Copy link

GH-15846 is a backport of this pull request to the 3.8 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.8 only security fixes label Sep 10, 2019
JulienPalard pushed a commit that referenced this pull request Sep 10, 2019
…configparser (GH-6137) (GH-15845)

Document how $ and % can be escaped in configparser.
(cherry picked from commit 9a94093)

Co-authored-by: Arun Persaud <arun@nubati.net>
JulienPalard pushed a commit that referenced this pull request Sep 10, 2019
…configparser (GH-6137) (GH-15846)

Document how $ and % can be escaped in configparser.
(cherry picked from commit 9a94093)

Co-authored-by: Arun Persaud <arun@nubati.net>
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
…configparser (pythonGH-6137)

Document how $ and % can be escaped in configparser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants