configparser.InterpolationDepthError

exception configparser.InterpolationDepthError Exception raised when string interpolation cannot be completed because the number of iterations exceeds MAX_INTERPOLATION_DEPTH. Subclass of InterpolationError.

configparser.ExtendedInterpolation

class configparser.ExtendedInterpolation An alternative handler for interpolation which implements a more advanced syntax, used for instance in zc.buildout. Extended interpolation is using ${section:option} to denote a value from a foreign section. Interpolation can span multiple levels. For convenience, if the section: part is omitted, interpolation defaults to the current section (and possibly the default values from the special section). For example, the configuration specified above with

configparser.Error

exception configparser.Error Base class for all other configparser exceptions.

configparser.DuplicateSectionError

exception configparser.DuplicateSectionError Exception raised if add_section() is called with the name of a section that is already present or in strict parsers when a section if found more than once in a single input file, string or dictionary. New in version 3.2: Optional source and lineno attributes and arguments to __init__() were added.

configparser.DuplicateOptionError

exception configparser.DuplicateOptionError Exception raised by strict parsers if a single option appears twice during reading from a single file, string or dictionary. This catches misspellings and case sensitivity-related errors, e.g. a dictionary may have two keys representing the same case-insensitive configuration key.

configparser.ConfigParser.write()

write(fileobject, space_around_delimiters=True) Write a representation of the configuration to the specified file object, which must be opened in text mode (accepting strings). This representation can be parsed by a future read() call. If space_around_delimiters is true, delimiters between keys and values are surrounded by spaces.

configparser.ConfigParser.set()

set(section, option, value) If the given section exists, set the given option to the specified value; otherwise raise NoSectionError. option and value must be strings; if not, TypeError is raised.

configparser.ConfigParser.sections()

sections() Return a list of the sections available; the default section is not included in the list.

configparser.ConfigParser.remove_section()

remove_section(section) Remove the specified section from the configuration. If the section in fact existed, return True. Otherwise return False.

configparser.ConfigParser.remove_option()

remove_option(section, option) Remove the specified option from the specified section. If the section does not exist, raise NoSectionError. If the option existed to be removed, return True; otherwise return False.