Add new scope name for configuration

@nedbat @cpennington This is the work on adding a named scope for configuration.
Why only these two exceptions? Should they both be subclasses of some common type of exception?