-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-65697: Prevent configparser from writing keys it cannot properly read #129270
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
Conversation
invalid key checks to seperate function
validating check readability
… into fix-issue-128843
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation looks sound and the tests seem to capture the essence of the change. I like it.
The only thing I'd like to see before accepting this - is there any lingering controversy? Who might oppose this change and can we get their consent?
If we can get consent from one or two of the most vocal detractors in the linked issues, then I'd say we could proceed. Otherwise, I'd like to hear their argument for what they recommend instead. Can you help gather that consensus?
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Thanks for reviewing, Jason!
Newlines, \r, and \x00 are still unhandled and it seemed like the consensus was that they should be. I'm working on a fix atm but what I've tried (checking for \n,\r,\x00 in everything when writing) breaks older test cases. I may need to make a second pull request later to fix that. @terryjreedy Do you have any thoughts on this change? You were pretty active in previous threads on this topic. |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
@bitdancer @vstinner Do you have any thoughts on this change? You both commented in previous threads on the topic. |
cc @ambv |
Let's give this until Mon, Feb 24 for comment. If there's no objection raised by then, we'll plan to proceed. If anyone needs more time, that's can be done too. |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
…erly read (python#129270) --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Prevents configparser from writing keys containing delimiters and keys beginning with the section header pattern to a file.
Both of those scenarios create .ini files the parser cannot accurately read back. Keys beginning with the section header pattern parse back as new sections. Keys containing delimiters parse back only the first portion as a key and the remainder as a value (i.e. key: 'one=two', value:'three' writes as 'one=two=three' and parses back as key: 'one', value: 'two=three').
Unsure on whether to handle newlines in key/section/values by rejecting them when writing, rejecting them when set, or escaping them when writing.