On this page
configparser.DuplicateSectionError
Prev: configparser.DuplicateOptionError | Up: configparser | Next: configparser.ExtendedInterpolation
Rel: configparser.BasicInterpolation, configparser.ConfigParser, configparser.ConverterMapping, configparser.DuplicateOptionError
Ref: docs.python.org โ configparser.DuplicateSectionError
Tags: #public #python3 #stdlib #configparser
Import
import configparser
from configparser import DuplicateSectionError
Signature & Overview
configparser.DuplicateSectionError(section, source=None, lineno=None)
Raised when a section is repeated in an input source.
Methods & Attributes
DuplicateSectionError.add_note(self, note, /)โ Add a note to the exceptionDuplicateSectionError.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import configparser
cp = configparser.ConfigParser(strict=True)
try:
cp.read_string("[s]\na = 1\n[s]\nb = 2\n")
except configparser.DuplicateSectionError:
assert True
Gotchas
- Raised on duplicate
[section]headers whenstrict=True.
REPL Inspect
from configparser import DuplicateSectionError
help(DuplicateSectionError)
Linked from
- tuts/python3/stdlib_module/configparser
- tuts/python3/stdlib_module/configparser/BasicInterpolation
- tuts/python3/stdlib_module/configparser/ConfigParser
- tuts/python3/stdlib_module/configparser/ConverterMapping
- tuts/python3/stdlib_module/configparser/DuplicateOptionError
- tuts/python3/stdlib_module/configparser/ExtendedInterpolation
Related notes
- tuts/python3/stdlib_module/configparser/BasicInterpolation Linked here; links to this page; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/ConfigParser Linked here; links to this page; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/ConverterMapping Linked here; links to this page; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/DuplicateOptionError Linked here; links to this page; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/ExtendedInterpolation Linked here; links to this page; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/configparser/Interpolation shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/InterpolationDepthError shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/InterpolationError shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/InterpolationMissingOptionError shared tags: #configparser, #stdlib