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

configparser.ParsingError

Prev: configparser.NoSectionError | Up: configparser | Next: configparser.RawConfigParser
Rel: configparser.BasicInterpolation, configparser.ConfigParser, configparser.ConverterMapping, configparser.DuplicateOptionError
Ref: docs.python.org — configparser.ParsingError
Tags: #public #python3 #stdlib #configparser


Import

import configparser
from configparser import ParsingError

Signature & Overview

configparser.ParsingError(source, *args)

Raised when a configuration file does not follow legal syntax.

Methods & Attributes

Usage

import configparser

cp = configparser.ConfigParser()
try:
    cp.read_string("[s]\nnot_a_key_value_line\n")
except configparser.ParsingError:
    assert True

Gotchas

REPL Inspect

from configparser import ParsingError
help(ParsingError)

Linked from

Related notes