Author jjdominguezm
Recipients jjdominguezm
Date 2009-08-21.08:57:55
SpamBayes Score 5.45147e-09
Marked as misclassified No
Message-id <>
I think it is useful, at least for me, to add an argument, default, to
[Safe,Raw]ConfigParser.get that, if present, will be returned if the
methid fails to return the value.

That is, instead of rasing an exception, return default, if present.

It could be done overriding the get method in SafeConfigParser,
something like this:

class SafeConfigParser(ConfigParser):
    def get(self, section, option, raw=False, vars=None, **kwds):
            return super().get(section, option, raw, vars)
        except Exception as exc:
            if "default" in kwds:
                return kwds["default"]
            raise exc
Date User Action Args
2009-08-21 08:57:57jjdominguezmsetrecipients: + jjdominguezm
2009-08-21 08:57:57jjdominguezmsetmessageid: <>
2009-08-21 08:57:56jjdominguezmlinkissue6751 messages
2009-08-21 08:57:55jjdominguezmcreate