On this page
  1. configparser.DuplicateSectionError
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

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

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

REPL Inspect

from configparser import DuplicateSectionError
help(DuplicateSectionError)

Linked from

Related notes