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

configparser.NoOptionError

Prev: configparser.MultilineContinuationError | Up: configparser | Next: configparser.NoSectionError
Rel: configparser.BasicInterpolation, configparser.ConfigParser, configparser.ConverterMapping, configparser.DuplicateOptionError
Ref: docs.python.org โ€” configparser.NoOptionError
Tags: #public #python3 #stdlib #configparser


Import

import configparser
from configparser import NoOptionError

Signature & Overview

configparser.NoOptionError(option, section)

A requested option was not found.

Methods & Attributes

Usage

import configparser

cp = configparser.ConfigParser()
cp.read_string("[s]\na = 1\n")
try:
    cp.get("s", "missing")
except configparser.NoOptionError:
    assert True

Gotchas

REPL Inspect

from configparser import NoOptionError
help(NoOptionError)

Linked from

Related notes