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

configparser.MissingSectionHeaderError

Prev: configparser.InvalidWriteError | Up: configparser | Next: configparser.MultilineContinuationError
Rel: configparser.BasicInterpolation, configparser.ConfigParser, configparser.ConverterMapping, configparser.DuplicateOptionError
Ref: docs.python.org — configparser.MissingSectionHeaderError
Tags: #public #python3 #stdlib #configparser


Import

import configparser
from configparser import MissingSectionHeaderError

Signature & Overview

configparser.MissingSectionHeaderError(filename, lineno, line)

Raised when a key-value pair is found before any section header.

Methods & Attributes

Usage

import configparser

cp = configparser.ConfigParser()
try:
    cp.read_string("key = value\n")
except configparser.MissingSectionHeaderError:
    assert True

Gotchas

REPL Inspect

from configparser import MissingSectionHeaderError
help(MissingSectionHeaderError)

Linked from

Related notes