Skip to content

gh-155436: Fix configparser.getboolean() for value-less options - #155437

Open
lpyu001 wants to merge 1 commit into
python:mainfrom
lpyu001:fix-configparser.getboolean-bug
Open

gh-155436: Fix configparser.getboolean() for value-less options#155437
lpyu001 wants to merge 1 commit into
python:mainfrom
lpyu001:fix-configparser.getboolean-bug

Conversation

@lpyu001

@lpyu001 lpyu001 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Comment thread Lib/configparser.py
"""
if value is None:
raise ValueError('Not a boolean: None')
if value.lower() not in self.BOOLEAN_STATES:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if value.lower() not in self.BOOLEAN_STATES:
if value is None or value.lower() not in self.BOOLEAN_STATES:

Comment thread Lib/configparser.py
Comment on lines +1225 to +1226
if value is None:
raise ValueError('Not a boolean: None')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if value is None:
raise ValueError('Not a boolean: None')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants