Author Claudiu.Popa
Recipients Claudiu.Popa
Date 2014-04-05.10:35:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The error message from the title is not very intuitive from a user point of view. For instance, in the following traceback, only the first one gives a meaning to this error, through the leaked KeyError, thus the user knows that home_dir1 is invalid and missing. But the second message with "Bad value substitution" doesn't emphasize the actual problem and you have to stare at it for a couple of moments to figure out what's happening and why. Maybe changing the "Bad value substitution" with a "Missing value" would suffice. This came up in issue19546. 

Traceback (most recent call last):
  File "C:\Python34\lib\", line 410, in _interpolate_some
    v = map[var]
  File "C:\Python34\lib\collections\", line 789, in __getitem__
    return self.__missing__(key)            # support subclasses that define __missing__
  File "C:\Python34\lib\collections\", line 781, in __missing__
    raise KeyError(key)
KeyError: 'home_dir1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python34\lib\", line 1204, in __getitem__
    return self._parser.get(self._name, key)
  File "C:\Python34\lib\", line 773, in get
  File "C:\Python34\lib\", line 374, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "C:\Python34\lib\", line 413, in _interpolate_some
    option, section, rest, var)
configparser.InterpolationMissingOptionError: Bad value substitution:
        section: [Paths]
        option : my_dir
        key    : home_dir1
        rawval : /lumberjack
Date User Action Args
2014-04-05 10:35:12Claudiu.Popasetrecipients: + Claudiu.Popa
2014-04-05 10:35:12Claudiu.Popasetmessageid: <>
2014-04-05 10:35:12Claudiu.Popalinkissue21159 messages
2014-04-05 10:35:10Claudiu.Popacreate