From 3adef87e71d92d27a832a31342c6d5249ddb42bb Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 21 Feb 2013 06:11:19 -0500 Subject: [PATCH] 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 --- rss2email/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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( -- 2.26.2