Message215334
But the last traceback conveys enough information, the user can see immediately that the given section does not exist.
My problem with the current behaviour is that the first error distracts the user, while the actual problem is the second traceback.
But I have another example which might contradict my proposal. In the example in the second traceback, it's not clear what `Bad value substitution` stands for and the first traceback adds the relevant context (the fact that key is missing). But I guess this stands for another issue, for enhancing the message for InterpolationMissingOptionError to transmit the fact that a given option is missing.
Traceback (most recent call last):
File "C:\Python34\lib\configparser.py", line 410, in _interpolate_some
v = map[var]
File "C:\Python34\lib\collections\__init__.py", line 789, in __getitem__
return self.__missing__(key) # support subclasses that define __missing__
File "C:\Python34\lib\collections\__init__.py", 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\configparser.py", line 1204, in __getitem__
return self._parser.get(self._name, key)
File "C:\Python34\lib\configparser.py", line 773, in get
d)
File "C:\Python34\lib\configparser.py", line 374, in before_get
self._interpolate_some(parser, option, L, value, section, defaults, 1)
File "C:\Python34\lib\configparser.py", 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-01 17:33:01 | Claudiu.Popa | set | recipients:
+ Claudiu.Popa, r.david.murray, lukasz.langa |
2014-04-01 17:33:01 | Claudiu.Popa | set | messageid: <1396373581.67.0.972684284984.issue19546@psf.upfronthosting.co.za> |
2014-04-01 17:33:01 | Claudiu.Popa | link | issue19546 messages |
2014-04-01 17:33:01 | Claudiu.Popa | create | |
|