Skip to content

configparser: allow ConfigParser()[UNNAMED_SECTION]#14759

Merged
srittau merged 1 commit intopython:mainfrom
trillllian:main
Sep 22, 2025
Merged

configparser: allow ConfigParser()[UNNAMED_SECTION]#14759
srittau merged 1 commit intopython:mainfrom
trillllian:main

Conversation

@trillllian
Copy link
Copy Markdown
Contributor

This probably should have been part of #13544, but seems to have been forgotten.

Fixes a type error on the last line of:

import configparser
config = configparser.ConfigParser(allow_unnamed_section=True)
config.read_string("a = b")
config[configparser.UNNAMED_SECTION]

@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Copy Markdown
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thanks!

@srittau srittau merged commit b195038 into python:main Sep 22, 2025
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants