Message60620
ConfigParser.get has an optional argument vars that -
according to the docstring- "which must be a dictionary
whose contents overrides any pre-existing defaults."
I understand that it overrides the default values, but
should not override an actual value existing in the file.
That is, given this contents:
[DEFAULT]
key1=default1
[section]
key2=value2
vars={'key1:vars1','key2:vars2'}
cfg.get('section','key1',0,vars) gives 'vars1' (ok)
cfg.get('section','key2',0,vars) gives 'vars2' (wrong,
should be 'value2', since key2 is actually in the section
and no default is needed).
To correct this behavior, simply move this two lines of
code up in ConfigParser.get (ConfigParser.py), just below
the first line and before the first try/except:
# Update with the entry specific variables
if vars is not None:
d.update(vars)
|
|
Date |
User |
Action |
Args |
2008-01-20 09:57:21 | admin | link | issue1090076 messages |
2008-01-20 09:57:21 | admin | create | |
|