# Buggy code
def _process(self, dryrun, msg, show):
    if msg:
        msg = MessageFactory.serialize(self.arg2msg(msg))
        if not self.instance._Bot__source_pipeline:
            # is None if source pipeline does not exist
            self.instance._Bot__source_pipeline = Pipeline(None)
        self.instance._Bot__source_pipeline.receive = lambda: msg
        self.instance._Bot__source_pipeline.acknowledge = lambda: None
        self.instance.logger.info(" * Message from cli will be used when processing.")

    if dryrun:
        self.instance.send_message = (
            lambda msg, path="_default": self.instance.logger.info(
                "DRYRUN: Message would be sent now{}!".format(
                    " to the {} path".format(path) if (path != "_default") else ""
                )
            )
        )
        self.instance.acknowledge_message = lambda: self.instance.logger.info(
            "DRYRUN: Message would be acknowledged now!"
        )
        self.instance.logger.info(
            " * Dryrun only, no message will be really sent through."
        )

    if show:
        fn = self.instance.send_message
        self.instance.send_message = lambda msg=None, path="_default": [
            self.pprint(msg or "No message generated"),
            fn(msg, path=path),
        ]

    self.instance.logger.info("Processing...")
    self.instance.process()


# Traceback (TypeError)
intelmqctl run Filter-Expert process --show-sent --msg ' { "source.ip": "93.184.216.34", "source.geolocation.cc": "UU", "time.observation": "2015-01-01T00:00:00+00:00" }'


Traceback (most recent call last):
File "/bin/intelmqctl", line 11, in <module>
load_entry_point('intelmq==2.0.1', 'console_scripts', 'intelmqctl')()
File "/usr/lib/python3.6/site-packages/intelmq/bin/intelmqctl.py", line 1710, in main
return x.run()
File "/usr/lib/python3.6/site-packages/intelmq/bin/intelmqctl.py", line 948, in run
retval, results = args.func(**args_dict)
File "/usr/lib/python3.6/site-packages/intelmq/bin/intelmqctl.py", line 955, in bot_run
return self.bot_process_manager.bot_run(**kwargs), None
File "/usr/lib/python3.6/site-packages/intelmq/bin/intelmqctl.py", line 162, in bot_run
loglevel=loglevel)
File "/usr/lib/python3.6/site-packages/intelmq/lib/bot_debugger.py", line 60, in __init__
self._process(dryrun, msg, show)
File "/usr/lib/python3.6/site-packages/intelmq/lib/bot_debugger.py", line 142, in _process
self.instance.process()
File "/usr/lib/python3.6/site-packages/intelmq/bots/experts/filter/expert.py", line 125, in process
path_permissive=True)
TypeError: <lambda>() got an unexpected keyword argument 'path_permissive'

# Fixed code
def _process(self, dryrun, msg, show):
    if msg:
        msg = MessageFactory.serialize(self.arg2msg(msg))
        if not self.instance._Bot__source_pipeline:
            # is None if source pipeline does not exist
            self.instance._Bot__source_pipeline = Pipeline(None)
        self.instance._Bot__source_pipeline.receive = lambda *args, **kwargs: msg
        self.instance._Bot__source_pipeline.acknowledge = lambda *args, **kwargs: None
        self.instance.logger.info(" * Message from cli will be used when processing.")

    if dryrun:
        self.instance.send_message = lambda *args, **kwargs: self.instance.logger.info(
            "DRYRUN: Message would be sent now to %r!", kwargs.get("path", "_default")
        )
        self.instance.acknowledge_message = (
            lambda *args, **kwargs: self.instance.logger.info(
                "DRYRUN: Message would be acknowledged now!"
            )
        )
        self.instance.logger.info(
            " * Dryrun only, no message will be really sent through."
        )

    if show:
        fn = self.instance.send_message
        self.instance.send_message = lambda *args, **kwargs: [
            self.pprint(args or "No message generated"),
            fn(*args, **kwargs),
        ]

    self.instance.logger.info("Processing...")
    self.instance.process()