aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/configparser.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/configparser.py')
-rw-r--r--Lib/configparser.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/configparser.py b/Lib/configparser.py
index c88605feff7..ea788aec510 100644
--- a/Lib/configparser.py
+++ b/Lib/configparser.py
@@ -1208,8 +1208,16 @@ class ConfigParser(RawConfigParser):
def _read_defaults(self, defaults):
"""Reads the defaults passed in the initializer, implicitly converting
- values to strings like the rest of the API."""
- self.read_dict({self.default_section: defaults})
+ values to strings like the rest of the API.
+
+ Does not perform interpolation for backwards compatibility.
+ """
+ try:
+ hold_interpolation = self._interpolation
+ self._interpolation = Interpolation()
+ self.read_dict({self.default_section: defaults})
+ finally:
+ self._interpolation = hold_interpolation
class SafeConfigParser(ConfigParser):