          with open(self.configfile, "w") as f_cfgfile:
              self.config.write(f_cfgfile)
          logger.debug("Updated config at: '%s'", self.configfile)
  
      def validate_config(self):
          """ Check for options in default config against saved config
              and add/remove as appropriate """
          logger.debug("Validating config")
          if self.check_config_change():
              self.add_new_config_items()
 
</s> remove         with open(self.configfile, "w") as f_cfgfile:
 </s> add         with open(self.configfile, "w", encoding="utf-8", errors="replace") as f_cfgfile: </s> remove         if self.check_config_change():
            self.add_new_config_items()
        self.check_config_choices()
 </s> add         if self._check_config_change():
            self._add_new_config_items()
        self._check_config_choices() </s> remove     def save_config(self):
 </s> add     def save_config(self) -> None: </s> remove         logger.verbose("Loading config: '%s'", self.configfile)
 </s> add         logger.verbose("Loading config: '%s'", self.configfile)  # type:ignore[attr-defined] </s> remove     def check_config_change(self):
        """ Check whether new default items have been added or removed
            from the config file compared to saved version """
 </s> add     def _check_config_change(self) -> bool:
        """ Check whether new default items have been added or removed from the config file
        compared to saved version

        Returns
        -------
        bool
            ``True`` if a config option has been added or removed
        """
    def _validate_config(self) -> None:
          with open(self.configfile, "w") as f_cfgfile:
              self.config.write(f_cfgfile)
          logger.debug("Updated config at: '%s'", self.configfile)
  
    def _validate_config(self) -> None:
          """ Check for options in default config against saved config
              and add/remove as appropriate """
          logger.debug("Validating config")
          if self.check_config_change():
              self.add_new_config_items()
keep keep keep keep replace keep keep keep keep keep
 Preview - Allow mask color/opacity configuration
  - typing: lib.config
  - docs: lib.config
  - bugfix: popup_configure - keep assets on top 
lib/config.py