From: W. Trevor King Date: Thu, 21 Feb 2013 11:11:19 +0000 (-0500) Subject: config: Use extended interpolation in Config X-Git-Tag: v3.2~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3adef87;p=rss2email.git config: Use extended interpolation in Config This avoids triggering accidental interpolation errors when your URL contains percent signs (e.g. %2F). Curly braces, on the other hand, will never appear in an encoded URL. From RFC 1738: Unsafe: ... Other characters are unsafe because gateways and other transport agents are known to sometimes modify such characters. These characters are "{", "}", "|", "\", "^", "~", "[", "]", and "`". All unsafe characters must always be encoded within a URL. Signed-off-by: W. Trevor King --- diff --git a/rss2email/config.py b/rss2email/config.py index ebdd73f..22f8626 100644 --- a/rss2email/config.py +++ b/rss2email/config.py @@ -34,8 +34,11 @@ import html2text as _html2text class Config (_configparser.ConfigParser): - def __init__(self, **kwargs): - super(Config, self).__init__(dict_type=_collections.OrderedDict) + def __init__(self, dict_type=_collections.OrderedDict, + interpolation=_configparser.ExtendedInterpolation(), + **kwargs): + super(Config, self).__init__( + dict_type=dict_type, interpolation=interpolation, **kwargs) def _setup(self, section='DEFAULT'): _html2text.UNICODE_SNOB = self.getboolean(