# Buggy code
def ParseFileObject(self, parser_mediator, file_object):
    """Parses a CUPS IPP file-like object.

    Args:
      parser_mediator (ParserMediator): mediates interactions between parsers
          and other components, such as storage and dfvfs.
      file_object (dfvfs.FileIO): file-like object.

    Raises:
      UnableToParseFile: when the file cannot be parsed.
    """
    self._last_charset_attribute = "ascii"

    self._ParseHeader(parser_mediator, file_object)

    data_dict = {}
    time_dict = {}
    is_first_attribute_group = True

    try:
        for name, value in self._ParseAttributesGroup(file_object):
            name = self._ATTRIBUTE_NAME_TRANSLATION.get(name, name)

            if name in self._DATE_TIME_VALUE_NAMES:
                time_dict.setdefault(name, []).append(value)
            else:
                data_dict.setdefault(name, []).append(value)

            is_first_attribute_group = False

    except (ValueError, errors.ParseError) as exception:
        error_message = ("unable to parse attribute group with error: {0!s}").format(
            exception
        )
        if is_first_attribute_group:
            raise errors.UnableToParseFile(error_message)

        parser_mediator.ProduceExtractionWarning(error_message)
        return

    event_data = CupsIppEventData()
    event_data.application = self._GetStringValue(data_dict, "application")
    event_data.computer_name = self._GetStringValue(data_dict, "computer_name")
    event_data.copies = data_dict.get("copies", [0])[0]
    event_data.data_dict = data_dict
    event_data.doc_type = self._GetStringValue(data_dict, "doc_type")
    event_data.job_id = self._GetStringValue(data_dict, "job_id")
    event_data.job_name = self._GetStringValue(data_dict, "job_name")
    event_data.user = self._GetStringValue(data_dict, "user")
    event_data.owner = self._GetStringValue(data_dict, "owner")
    event_data.printer_id = self._GetStringValue(data_dict, "printer_id")
    event_data.uri = self._GetStringValue(data_dict, "uri")

    for name, usage in iter(self._DATE_TIME_VALUES.items()):
        for date_time in time_dict.get(name, []):
            event = time_events.DateTimeValuesEvent(date_time, usage)
            parser_mediator.ProduceEventWithEventData(event, event_data)

    for name, usage in iter(self._POSIX_TIME_VALUES.items()):
        for time_value in time_dict.get(name, []):
            date_time = dfdatetime_posix_time.PosixTime(timestamp=time_value)
            event = time_events.DateTimeValuesEvent(date_time, usage)
            parser_mediator.ProduceEventWithEventData(event, event_data)


# Traceback (ValueError)
Traceback (most recent call last):
File "plaso/tools/log2timeline.py", line 97, in <module>
if not Main():
File "plaso/tools/log2timeline.py", line 72, in Main
tool.ExtractEventsFromSources()
File "plaso/plaso/cli/log2timeline_tool.py", line 448, in ExtractEventsFromSources
worker_memory_limit=self._worker_memory_limit)
File "plaso/plaso/multi_processing/task_engine.py", line 812, in ProcessSources
self._ProcessSources(source_path_specs, storage_writer)
File "plaso/plaso/multi_processing/task_engine.py", line 343, in _ProcessSources
self._ScheduleTasks(storage_writer)
File "plaso/plaso/multi_processing/task_engine.py", line 449, in _ScheduleTasks
self._MergeTaskStorage(storage_writer)
File "plaso/plaso/multi_processing/task_engine.py", line 256, in _MergeTaskStorage
maximum_number_of_containers=self._MAXIMUM_NUMBER_OF_CONTAINERS)
File "plaso/plaso/storage/sqlite/merge_reader.py", line 278, in MergeAttributeContainers
self._active_container_type, serialized_data)
File "plaso/plaso/storage/interface.py", line 600, in _DeserializeAttributeContainer
attribute_container = self._serializer.ReadSerialized(serialized_string)
File "plaso/plaso/serializer/json_serializer.py", line 404, in ReadSerialized
return cls.ReadSerializedDict(json_dict)
File "plaso/plaso/serializer/json_serializer.py", line 423, in ReadSerializedDict
json_object = cls._ConvertDictToObject(json_dict)
File "plaso/plaso/serializer/json_serializer.py", line 252, in _ConvertDictToObject
'supported.').format(attribute_name))
ValueError: Event data attribute value: return_value of type dict is not supported.

# Fixed code
def ParseFileObject(self, parser_mediator, file_object):
    """Parses a CUPS IPP file-like object.

    Args:
      parser_mediator (ParserMediator): mediates interactions between parsers
          and other components, such as storage and dfvfs.
      file_object (dfvfs.FileIO): file-like object.

    Raises:
      UnableToParseFile: when the file cannot be parsed.
    """
    self._last_charset_attribute = "ascii"

    self._ParseHeader(parser_mediator, file_object)

    data_dict = {}
    time_dict = {}
    is_first_attribute_group = True

    try:
        for name, value in self._ParseAttributesGroup(file_object):
            name = self._ATTRIBUTE_NAME_TRANSLATION.get(name, name)

            if name in self._DATE_TIME_VALUE_NAMES:
                time_dict.setdefault(name, []).append(value)
            else:
                data_dict.setdefault(name, []).append(value)

            is_first_attribute_group = False

    except (ValueError, errors.ParseError) as exception:
        error_message = ("unable to parse attribute group with error: {0!s}").format(
            exception
        )
        if is_first_attribute_group:
            raise errors.UnableToParseFile(error_message)

        parser_mediator.ProduceExtractionWarning(error_message)
        return

    event_data = CupsIppEventData()
    event_data.application = self._GetStringValue(data_dict, "application")
    event_data.computer_name = self._GetStringValue(data_dict, "computer_name")
    event_data.copies = data_dict.get("copies", [0])[0]
    event_data.doc_type = self._GetStringValue(data_dict, "doc_type")
    event_data.job_id = self._GetStringValue(data_dict, "job_id")
    event_data.job_name = self._GetStringValue(data_dict, "job_name")
    event_data.user = self._GetStringValue(data_dict, "user")
    event_data.owner = self._GetStringValue(data_dict, "owner")
    event_data.printer_id = self._GetStringValue(data_dict, "printer_id")
    event_data.uri = self._GetStringValue(data_dict, "uri")

    for name, usage in iter(self._DATE_TIME_VALUES.items()):
        for date_time in time_dict.get(name, []):
            event = time_events.DateTimeValuesEvent(date_time, usage)
            parser_mediator.ProduceEventWithEventData(event, event_data)

    for name, usage in iter(self._POSIX_TIME_VALUES.items()):
        for time_value in time_dict.get(name, []):
            date_time = dfdatetime_posix_time.PosixTime(timestamp=time_value)
            event = time_events.DateTimeValuesEvent(date_time, usage)
            parser_mediator.ProduceEventWithEventData(event, event_data)