          serializer = JSONSerializer
          menu_file = os.path.join(self.config.pathcache, ".recent.json")
          if not os.path.isfile(menu_file) or os.path.getsize(menu_file) == 0:
              self.clear_recent_files(serializer, menu_file)
          with open(menu_file, "rb") as inp:
              recent_files = serializer.unmarshal(inp.read().decode("utf-8"))
              logger.debug("Loaded recent files: %s", recent_files)
          for recent_item in recent_files:
              filename, command = recent_item
              logger.debug("processing: ('%s', %s)", filename, command)
              lbl_command = command if command else "All"
              self.recent_menu.add_command(
 
</s> remove         serializer = JSONSerializer
 </s> add         serializer = get_serializer("json") </s> remove             with open(recent_filename, "rb") as inp:
                recent_files = self.serializer.unmarshal(inp.read().decode("utf-8"))
 </s> add             recent_files = self.serializer.load(recent_filename) </s> remove             cfg = self.serializer.unmarshal(cfgfile.read())
 </s> add             filename = cfgfile.name
            cfgfile.close()
            cfg = self.serializer.load(filename) </s> remove         self.add_to_recent(cfgfile.name, command)
        logger.debug("Saved config: (command: '%s', cfgfile: '%s')", command, cfgfile)
 </s> add         cfg = self.cli_opts.get_option_values(command)
        self.serializer.save(filename, cfg)
        self.add_to_recent(filename, command)
        logger.debug("Saved config: (command: '%s', filename: '%s')", command, filename) </s> remove         recent_json = self.serializer.marshal(recent_files)
        with open(recent_filename, "wb") as out:
            out.write(recent_json.encode("utf-8"))
 </s> add         self.serializer.save(recent_filename, recent_files)
        recent_files = serializer.load(menu_file)
        logger.debug("Loaded recent files: %s", recent_files)
          serializer = JSONSerializer
          menu_file = os.path.join(self.config.pathcache, ".recent.json")
          if not os.path.isfile(menu_file) or os.path.getsize(menu_file) == 0:
              self.clear_recent_files(serializer, menu_file)
        recent_files = serializer.load(menu_file)
        logger.debug("Loaded recent files: %s", recent_files)
        recent_files = serializer.load(menu_file)
        logger.debug("Loaded recent files: %s", recent_files)
        recent_files = serializer.load(menu_file)
        logger.debug("Loaded recent files: %s", recent_files)
          for recent_item in recent_files:
              filename, command = recent_item
              logger.debug("processing: ('%s', %s)", filename, command)
              lbl_command = command if command else "All"
              self.recent_menu.add_command(
keep keep keep keep replace replace replace keep keep keep keep keep
 Standardize serialization (#903)

* Standardize serialization

- Linting
- Standardize serializer use throughout code
- Extend serializer to load and save files
- Always load and save in utf-8
- Create documentation 
lib/gui/menu.py