# Buggy code
def _ProcessPathSpec(self, extraction_worker, parser_mediator, path_spec):
    """Processes a path specification.

    Args:
      extraction_worker (worker.ExtractionWorker): extraction worker.
      parser_mediator (ParserMediator): parser mediator.
      path_spec (dfvfs.PathSpec): path specification.
    """
    self._current_display_name = parser_mediator.GetDisplayNameForPathSpec(path_spec)

    try:
        extraction_worker.ProcessPathSpec(parser_mediator, path_spec)

    except KeyboardInterrupt:
        self._abort = True

        self._processing_status.aborted = True
        if self._status_update_callback:
            self._status_update_callback(self._processing_status)

    # We cannot recover from a CacheFullError and abort processing when
    # it is raised.
    except dfvfs_errors.CacheFullError:
        # TODO: signal engine of failure.
        self._abort = True
        logging.error(
            (
                "ABORT: detected cache full error while processing path spec: {0:s}"
            ).format(self._current_display_name)
        )

    # All exceptions need to be caught here to prevent the worker
    # from being killed by an uncaught exception.
    except Exception as exception:  # pylint: disable=broad-except
        parser_mediator.ProduceExtractionError(
            ("unable to process path specification with error: {0:s}").format(
                exception
            ),
            path_spec=path_spec,
        )

        if self._processing_configuration.debug_output:
            logging.warning(
                "Unhandled exception while processing path spec: {0:s}.".format(
                    self._current_display_name
                )
            )
            logging.exception(exception)

            pdb.post_mortem()


# Traceback (AttributeError)
Traceback (most recent call last):
File "./tools/log2timeline.py", line 678, in <module>
if not Main():
File "./tools/log2timeline.py", line 664, in Main
tool.ProcessSources()
File "./tools/log2timeline.py", line 575, in ProcessSources
worker_memory_limit=self._worker_memory_limit)
File "/tmp/test/plaso/frontend/extraction_frontend.py", line 379, in ProcessSources
status_update_callback=status_update_callback)
File "/tmp/test/plaso/engine/single_process.py", line 330, in ProcessSources
storage_writer, filter_find_specs=filter_find_specs)
File "/tmp/test/plaso/engine/single_process.py", line 147, in _ProcessSources
extraction_worker, parser_mediator, event_source.path_spec)
File "/tmp/test/plaso/engine/single_process.py", line 77, in _ProcessPathSpec
if self._processing_configuration.debug_output:
AttributeError: 'NoneType' object has no attribute 'debug_output'

# Fixed code
def _ProcessPathSpec(self, extraction_worker, parser_mediator, path_spec):
    """Processes a path specification.

    Args:
      extraction_worker (worker.ExtractionWorker): extraction worker.
      parser_mediator (ParserMediator): parser mediator.
      path_spec (dfvfs.PathSpec): path specification.
    """
    self._current_display_name = parser_mediator.GetDisplayNameForPathSpec(path_spec)

    try:
        extraction_worker.ProcessPathSpec(parser_mediator, path_spec)

    except KeyboardInterrupt:
        self._abort = True

        self._processing_status.aborted = True
        if self._status_update_callback:
            self._status_update_callback(self._processing_status)

    # We cannot recover from a CacheFullError and abort processing when
    # it is raised.
    except dfvfs_errors.CacheFullError:
        # TODO: signal engine of failure.
        self._abort = True
        logging.error(
            (
                "ABORT: detected cache full error while processing path spec: {0:s}"
            ).format(self._current_display_name)
        )

    # All exceptions need to be caught here to prevent the worker
    # from being killed by an uncaught exception.
    except Exception as exception:  # pylint: disable=broad-except
        parser_mediator.ProduceExtractionError(
            ("unable to process path specification with error: {0:s}").format(
                exception
            ),
            path_spec=path_spec,
        )

        if getattr(self._processing_configuration, "debug_output", False):
            logging.warning(
                "Unhandled exception while processing path spec: {0:s}.".format(
                    self._current_display_name
                )
            )
            logging.exception(exception)

            pdb.post_mortem()