# Buggy code
def __init__(
    self,
    runtime_configuration,
    bot_id,
    run_subcommand=None,
    console_type=None,
    message_kind=None,
    dryrun=None,
    msg=None,
    show=None,
    loglevel=None,
):
    self.runtime_configuration = runtime_configuration
    module = import_module(self.runtime_configuration["module"])

    if loglevel:
        self.leverageLogger(loglevel)
    elif run_subcommand == "console":
        self.leverageLogger("DEBUG")

    bot = getattr(module, "BOT")
    if run_subcommand == "message":
        bot.init = lambda *args: None
    self.instance = bot(bot_id, disable_multithreading=True)

    if not run_subcommand:
        self.instance.start()
    else:
        self.instance._Bot__connect_pipelines()
        if run_subcommand == "console":
            self._console(console_type)
        elif run_subcommand == "message":
            self._message(message_kind, msg)
            return
        elif run_subcommand == "process":
            self._process(dryrun, msg, show)
        else:
            print("Subcommand {} not known.".format(run_subcommand))


# 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 __init__(
    self,
    runtime_configuration,
    bot_id,
    run_subcommand=None,
    console_type=None,
    message_kind=None,
    dryrun=None,
    msg=None,
    show=None,
    loglevel=None,
):
    self.runtime_configuration = runtime_configuration
    module = import_module(self.runtime_configuration["module"])

    if loglevel:
        self.leverageLogger(loglevel)
    elif run_subcommand == "console":
        self.leverageLogger("DEBUG")

    bot = getattr(module, "BOT")
    if run_subcommand == "message":
        bot.init = lambda *args, **kwargs: None
    self.instance = bot(bot_id, disable_multithreading=True)

    if not run_subcommand:
        self.instance.start()
    else:
        self.instance._Bot__connect_pipelines()
        if run_subcommand == "console":
            self._console(console_type)
        elif run_subcommand == "message":
            self._message(message_kind, msg)
            return
        elif run_subcommand == "process":
            self._process(dryrun, msg, show)
        else:
            print("Subcommand {} not known.".format(run_subcommand))