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

Appearance settings
Prev Previous commit
Next Next commit
undo one
  • Loading branch information
JelleZijlstra committed May 6, 2026
commit 0ebd18452c799b06f20fec735a3f8de6bd855771
7 changes: 6 additions & 1 deletion 7 Lib/configparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@ def __init__(self):
Error.__init__(self, "Support for UNNAMED_SECTION is disabled.")


class _UnnamedSection:

def __repr__(self):
return "<UNNAMED_SECTION>"

class InvalidWriteError(Error):
"""Raised when attempting to write data that the parser would read back differently.
ex: writing a key which begins with the section header pattern would read back as a
Expand All @@ -381,7 +386,7 @@ def __init__(self, msg=''):
Error.__init__(self, msg)


UNNAMED_SECTION = sentinel("<UNNAMED_SECTION>")
UNNAMED_SECTION = _UnnamedSection()


# Used in parser getters to indicate the default behaviour when a specific
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.