code: def write(self, *args):
          
          ConfigParser.write(self, *args)
          if self.keyring_available:
              for key, thing in self._unsaved.items():
                  action = thing[0]
                  value = thing[1]
                  if action == 'set':
                      keyring.set_password(self.keyring_name, key, value)
                  elif action == 'delete':
                      try:
                          keyring.delete_password(self.keyring_name, key)
                      except:
                          pass
          self._unsaved = {}
docs: See ConfigParser.write().  Also writes secure items to keystore.