ConfigParser module changed name to configParser in PY3, additionally
the behaviour regarding interpolation has changed. ConfigParser now
has a default interpolation param whose behaviour demands that '%' is
escaped. To maintain behaviour with the python2 version this default
param needs to be changed. Add some alias(s) and 'shim' Configparser
symbol in samba.compat to cater for this.
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
# alias
import io
StringIO = io.StringIO
+ def ConfigParser(defaults=None, dict_type=None, allow_no_value=None):
+ from configparser import ConfigParser
+ return ConfigParser(defaults, dict_type, allow_no_value, interpolation=None)
else:
# Helper function to return bytes.
# if 'unicode' is passed in then it is decoded using 'utf8' and
# alias
import cStringIO
StringIO = cStringIO.StringIO
+ from ConfigParser import ConfigParser
cmp_fn = cmp