bpo-32108: Don't clear configparser values if key is assigned to itself (GH-7588)

This commit is contained in:
Cheryl Sabella 2018-06-12 16:37:51 -04:00 committed by Łukasz Langa
parent c3f55be7dd
commit 33cd058f21
3 changed files with 9 additions and 1 deletions

View file

@ -963,7 +963,8 @@ class RawConfigParser(MutableMapping):
def __setitem__(self, key, value):
# To conform with the mapping protocol, overwrites existing values in
# the section.
if key in self and self[key] is value:
return
# XXX this is not atomic if read_dict fails at any point. Then again,
# no update method in configparser is atomic in this implementation.
if key == self.default_section: