On this page
configparser.InterpolationDepthError
Prev: configparser.Interpolation | Up: configparser | Next: configparser.InterpolationError
Rel: configparser.BasicInterpolation, configparser.ConfigParser, configparser.ConverterMapping, configparser.DuplicateOptionError
Ref: docs.python.org — configparser.InterpolationDepthError
Tags: #public #python3 #stdlib #configparser
Import
import configparser
from configparser import InterpolationDepthError
Signature & Overview
configparser.InterpolationDepthError(option, section, rawval)
Raised when substitutions are nested too deeply.
Methods & Attributes
InterpolationDepthError.add_note(self, note, /)— Add a note to the exceptionInterpolationDepthError.with_traceback(self, tb, /)— Set self.traceback to tb and return self.
Usage
import configparser
cp = configparser.ConfigParser()
cp.read_string("[s]\na = %(b)s\nb = %(a)s\n")
try:
_ = cp["s"]["a"]
except configparser.InterpolationDepthError:
assert True
Gotchas
- Catches circular
%(a)s→%(b)s→%(a)sreferences (max depth 10).
REPL Inspect
from configparser import InterpolationDepthError
help(InterpolationDepthError)
Linked from
Related notes
- tuts/python3/stdlib_module/configparser/Interpolation Linked here; links to this page; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/InterpolationError Linked here; links to this page; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/BasicInterpolation Linked here; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/ConfigParser Linked here; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/ConverterMapping Linked here; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/DuplicateOptionError Linked here; shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/configparser/DuplicateSectionError shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/ExtendedInterpolation shared tags: #configparser, #stdlib
- tuts/python3/stdlib_module/configparser/InterpolationMissingOptionError shared tags: #configparser, #stdlib