Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-38741: Definition of multiple ']' in header configparser#17129

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

jsnklln
Copy link
Contributor

@jsnkllnjsnklln commentedNov 12, 2019
edited by bedevere-bot
Loading

I've changed up the regex for finding section headers.
I don't know if this covers every case but it covers
all the cases I could come up with. The docs don't really
call out if ] should be allowed in section headers but
I can't think of any reason it shouldn't be.

This change keeps the existing failure if you try and
define a section with no name, like [].

https://bugs.python.org/issue38741

I've changed up the regex for finding section headers.I don't know if this covers every case but it coversall the cases I could come up with.  The docs don't reallycall out if ] should be allowed in section headers butI can't think of any reason it shouldn't be.This change keeps the existing failure if you try anddefine a section with no name, like [].
@brandtbucherbrandtbucher added the type-bugAn unexpected behavior, bug, or error labelNov 12, 2019
@brandtbucher
Copy link
Member

Thanks@jsnklln!

Copy link
Member

@brandtbucherbrandtbucher left a comment
edited
Loading

Choose a reason for hiding this comment

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

The patch itself looks good, but I don't know enough about this module to decide if this behavior is technically correct or not.@ambv, thoughts?

Also, this probably needs a test or two. Can you include them intest_configparser.py?

@jsnklln
Copy link
ContributorAuthor

@brandtbucher adding some tests sounds like fun. I'm totally open to opinions on how to best handle it.

brandtbucher reacted with thumbs up emoji

@mark99i
Copy link

its is a my commit!
46751c6
or was it not customary to point to the source?

@jsnklln
Copy link
ContributorAuthor

@mark99i I didn't realize we were working on the same bug. There's not a PR on the bug tracker and I'm pretty sure I pulled from changes master yesterday but I hay not have.

One note. Using .* allows [] to be considered valid where with the previous version it threw an exception. ConfigParser doesn't allow definitions without a section, I'm pretty sure that's still true, so I don't know where those would go if they were allowed.

mark99i reacted with thumbs up emoji

Jason Killen added2 commitsNovember 13, 2019 11:19
read correctly.  Included a check for key=value becausethe original issue mentioned that it might not be working.
@jsnklln
Copy link
ContributorAuthor

@brandtbucher tests have been pushed.

Copy link
Member

@brandtbucherbrandtbucher left a comment

Choose a reason for hiding this comment

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

Thanks@jsnklln! I recommended that#17086 be closed in favor of this, since it contains tests and handles the empty case.

@jsnklln
Copy link
ContributorAuthor

@brandtbucher thanks.@mark99i sorry we got our wires crossed up, I'll gladly split the credit.

@jsnklln
Copy link
ContributorAuthor

@brandtbucher is this waiting on something to be merged? Not being pushy just want to make sure I've got all my t's dotted.

@brandtbucher
Copy link
Member

Closing and reopening to trigger CI.

@brandtbucher
Copy link
Member

@ambv This patch is simple and looks fine to me. Do you mind clearing up whether or not it is correct to allow] in header names? If so, it can probably be merged.

@ambvambv merged commit2924bb1 intopython:mainJul 13, 2021
@ambvambv added the needs backport to 3.10only security fixes labelJul 13, 2021
@miss-islington
Copy link
Contributor

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

@bedevere-botbedevere-bot removed the needs backport to 3.10only security fixes labelJul 13, 2021
@bedevere-bot
Copy link

GH-27110 is a backport of this pull request to the3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJul 13, 2021
…H-17129)Co-authored-by: Jason Killen <jason.killen@windsorcircle.com>Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>(cherry picked from commit2924bb1)Co-authored-by: jsnklln <jsnklln@gmail.com>
@ambv
Copy link
Contributor

Sorry for taking so long to look at this 🤦🏻‍♂️

ambv pushed a commit that referenced this pull requestJul 13, 2021
… (#27110)Co-authored-by: Jason Killen <jason.killen@windsorcircle.com>Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>(cherry picked from commit2924bb1)Co-authored-by: jsnklln <jsnklln@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@brandtbucherbrandtbucherbrandtbucher approved these changes

@ambvambvAwaiting requested review from ambv

Assignees
No one assigned
Labels
type-bugAn unexpected behavior, bug, or error
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

7 participants
@jsnklln@brandtbucher@mark99i@miss-islington@bedevere-bot@ambv@the-knights-who-say-ni

[8]ページ先頭

©2009-2025 Movatter.jp