-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
gh-107625: configparser: Raise ParsingError if a key contains empty value #107651
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
Changes from 1 commit
ec49bca
1bcab3f
35fe7f1
0660a7e
317681c
ff8f339
778841d
ed50361
dc1faeb
1234b75
726264d
7ae72b6
da065f8
ee11915
0b87a9
8000
f
8c4907f
2b06e68
e58b11f
ca4839d
4383e06
2d367f1
9dc65ed
0303728
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -987,10 +987,10 @@ def _read(self, fp, fpname): | |
cur_indent_level = first_nonspace.start() if first_nonspace else 0 | ||
if (cursect is not None and optname and | ||
cur_indent_level > indent_level): | ||
if cursect[optname]: | ||
cursect[optname].append(value) | ||
else: | ||
raise ParsingError(f"No-value option {optname} cannot be continued") | ||
if cursect[optname]: | ||
cursect[optname].append(value) | ||
else: | ||
raise ParsingError(f"No-value option {optname} cannot be continued") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an invalid invocation of More importantly, instead of instantiating Also, unrelatedly, I would make the condition here in line 990 explicitly check for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, sure.
|
||
# a section header or option header? | ||
else: | ||
indent_level = cur_indent_level | ||
|
Uh oh!
There was an error while loading. Please reload this page.