# Buggy code
def GetDisplayNameForPathSpec(cls, path_spec, mount_path=None, text_prepend=None):
    """Retrieves the display name of a path specification.

    Args:
      path_spec (dfvfs.PathSpec): path specification.
      mount_path (Optional[str]): path where the file system that is used
          by the path specification is mounted, such as "/mnt/image". The
          mount path will be stripped from the absolute path defined by
          the path specification.
      text_prepend (Optional[str]): text to prepend.

    Returns:
      str: human readable version of the path specification or None.
    """
    if not path_spec:
        return None

    relative_path = cls.GetRelativePathForPathSpec(path_spec, mount_path=mount_path)
    if not relative_path:
        return path_spec.type_indicator

    if text_prepend:
        relative_path = "{0:s}{1:s}".format(text_prepend, relative_path)

    path_type_indicator = path_spec.type_indicator

    parent_path_spec = path_spec.parent
    if parent_path_spec:
        if path_spec.type_indicator == (
            dfvfs_definitions.TYPE_INDICATOR_COMPRESSED_STREAM
        ):
            path_type_indicator = path_spec.compression_method.upper()
            parent_path_spec = parent_path_spec.parent

        elif path_spec.type_indicator == dfvfs_definitions.TYPE_INDICATOR_GZIP:
            parent_path_spec = parent_path_spec.parent

    if parent_path_spec and parent_path_spec.type_indicator == (
        dfvfs_definitions.TYPE_INDICATOR_VSHADOW
    ):
        store_index = getattr(path_spec.parent, "store_index", None)
        if store_index is not None:
            return "VSS{0:d}:{1:s}:{2:s}".format(
                store_index + 1, path_spec.type_indicator, relative_path
            )

    return "{0:s}:{1:s}".format(path_type_indicator, relative_path)


# Traceback (plaso.lib.error)
2020-07-13 13:03:56,615 [INFO] (MainProcess) PID:4081 <data_location> Determined data location: /tmp/workspace/psort-linux-nsrlsvr/data
Traceback (most recent call last):
File "./tools/psort.py", line 99, in <module>
if not Main():
File "./tools/psort.py", line 76, in Main
tool.ProcessStorage()
File "/tmp/workspace/psort-linux-nsrlsvr/plaso/cli/psort_tool.py", line 558, in ProcessStorage
worker_memory_limit=self._worker_memory_limit)
File "/tmp/workspace/psort-linux-nsrlsvr/plaso/multi_processing/psort.py", line 944, in AnalyzeEvents
storage_writer, analysis_plugins, event_filter=event_filter)
File "/tmp/workspace/psort-linux-nsrlsvr/plaso/multi_processing/psort.py", line 306, in _AnalyzeEvents
event_queue.PushItem((event, event_data, event_data_stream))
File "/tmp/workspace/psort-linux-nsrlsvr/plaso/engine/zeromq_queue.py", line 457, in PushItem
raise errors.QueueFull
plaso.lib.errors.QueueFull

# Fixed code
def GetDisplayNameForPathSpec(cls, path_spec, mount_path=None, text_prepend=None):
    """Retrieves the display name of a path specification.

    Args:
      path_spec (dfvfs.PathSpec): path specification.
      mount_path (Optional[str]): path where the file system that is used
          by the path specification is mounted, such as "/mnt/image". The
          mount path will be stripped from the absolute path defined by
          the path specification.
      text_prepend (Optional[str]): text to prepend.

    Returns:
      str: human readable version of the path specification or None if no path
          specification was provided.
    """
    if not path_spec:
        return None

    relative_path = cls.GetRelativePathForPathSpec(path_spec, mount_path=mount_path)
    if not relative_path:
        return path_spec.type_indicator

    if text_prepend:
        relative_path = "{0:s}{1:s}".format(text_prepend, relative_path)

    path_type_indicator = path_spec.type_indicator

    parent_path_spec = path_spec.parent
    if parent_path_spec:
        if path_spec.type_indicator == (
            dfvfs_definitions.TYPE_INDICATOR_COMPRESSED_STREAM
        ):
            path_type_indicator = path_spec.compression_method.upper()
            parent_path_spec = parent_path_spec.parent

        elif path_spec.type_indicator == dfvfs_definitions.TYPE_INDICATOR_GZIP:
            parent_path_spec = parent_path_spec.parent

    if parent_path_spec and parent_path_spec.type_indicator == (
        dfvfs_definitions.TYPE_INDICATOR_VSHADOW
    ):
        store_index = getattr(path_spec.parent, "store_index", None)
        if store_index is not None:
            return "VSS{0:d}:{1:s}:{2:s}".format(
                store_index + 1, path_spec.type_indicator, relative_path
            )

    return "{0:s}:{1:s}".format(path_type_indicator, relative_path)