# Buggy code
def _ReadEventTagByIdentifier(self, store_number, entry_index, uuid):
    """Reads an event tag by identifier.

    Args:
      store_number: the store number.
      entry_index: an integer containing the serialized data stream entry index.
      uuid: the UUID string.

    Returns:
      The event tag (instance of EventTag).

    Raises:
      IOError: if the event tag data stream cannot be opened.
    """
    tag_index_value = self._GetEventTagIndexValue(store_number, entry_index, uuid)
    if tag_index_value is None:
        return

    stream_name = "plaso_tagging.{0:06d}".format(tag_index_value.store_number)
    if not self._HasStream(stream_name):
        raise IOError("No such stream: {0:s}".format(stream_name))

    data_stream = _SerializedDataStream(self._zipfile, self._path, stream_name)
    data_stream.SeekEntryAtOffset(entry_index, tag_index_value.store_offset)
    return data_stream.ReadEntry()


# Traceback (AttributeError)
2010-11-21T03:58:32.153973+00:00,Content Modification Time,EVT,WinEVTX,[109 / 0x006d] Record Number: 27 Event Level: 4 Source Name: Microsoft-Windows-Kernel-Power Computer Name: 37L4247F27-25 Message string: The kernel power manager has initiated a shutdown transition. Strings: ['5'  '0'  '0'],winevtx,OS:/mnt/Windows/System32/winevt/Logs/System.evtx,-,1,26
Traceback (most recent call last):
File "/usr/bin/psort.py", line 698, in <module>
if not Main():
File "/usr/bin/psort.py", line 693, in Main
tool.ProcessStorage()
File "/usr/bin/psort.py", line 642, in ProcessStorage
self._ProcessStorage()
File "/usr/bin/psort.py", line 267, in _ProcessStorage
time_slice=self._time_slice, use_time_slicer=self._use_time_slicer)
File "/usr/lib/python2.7/dist-packages/plaso/frontend/psort.py", line 525, in ProcessStorage
time_slice=time_slice)
File "/usr/lib/python2.7/dist-packages/plaso/output/event_buffer.py", line 49, in __exit__
self.End()
File "/usr/lib/python2.7/dist-packages/plaso/output/event_buffer.py", line 72, in End
self.Flush()
File "/usr/lib/python2.7/dist-packages/plaso/output/event_buffer.py", line 85, in Flush
self._output_module.WriteEvent(event_object)
File "/usr/lib/python2.7/dist-packages/plaso/output/interface.py", line 86, in WriteEvent
self.WriteEventBody(event_object)
File "/usr/lib/python2.7/dist-packages/plaso/output/dynamic.py", line 355, in WriteEventBody
output_value = callback_function(event_object)
File "/usr/lib/python2.7/dist-packages/plaso/output/dynamic.py", line 250, in _FormatTag
return u' '.join(tag.tags)
AttributeError: 'str' object has no attribute 'tags'

# Fixed code
def _ReadEventTagByIdentifier(self, store_number, entry_index, uuid):
    """Reads an event tag by identifier.

    Args:
      store_number: the store number.
      entry_index: an integer containing the serialized data stream entry index.
      uuid: the UUID string.

    Returns:
      The event tag (instance of EventTag).

    Raises:
      IOError: if the event tag data stream cannot be opened.
    """
    tag_index_value = self._GetEventTagIndexValue(store_number, entry_index, uuid)
    if tag_index_value is None:
        return

    stream_name = "plaso_tagging.{0:06d}".format(tag_index_value.store_number)
    if not self._HasStream(stream_name):
        raise IOError("No such stream: {0:s}".format(stream_name))

    data_stream = _SerializedDataStream(self._zipfile, self._path, stream_name)
    data_stream.SeekEntryAtOffset(entry_index, tag_index_value.store_offset)
    return self._ReadEventTag(data_stream)