# Buggy code
def __init__(self, *args, **kw):
    super(BugzillaService, self).__init__(*args, **kw)
    self.base_uri = self.config.get("base_uri")
    self.username = self.config.get("username")
    self.ignore_cc = self.config.get(
        "ignore_cc", default=False, to_type=lambda x: x == "True"
    )
    self.query_url = self.config.get("query_url", default=None)
    self.include_needinfos = self.config.get(
        "include_needinfos", False, to_type=lambda x: x == "True"
    )
    self.open_statuses = self.config.get(
        "open_statuses", _open_statuses, to_type=lambda x: x.split(",")
    )
    log.debug(" filtering on statuses: %r", self.open_statuses)

    # So more modern bugzilla's require that we specify
    # query_format=advanced along with the xmlrpc request.
    # https://bugzilla.redhat.com/show_bug.cgi?id=825370
    # ...but older bugzilla's don't know anything about that argument.
    # Here we make it possible for the user to specify whether they want
    # to pass that argument or not.
    self.advanced = asbool(self.config.get("advanced", "no"))

    url = "https://%s/xmlrpc.cgi" % self.base_uri
    api_key = self.config.get("api_key", default=None)
    if api_key:
        try:
            self.bz = bugzilla.Bugzilla(url=url, api_key=api_key)
        except TypeError:
            raise Exception("Bugzilla API keys require python-bugzilla>=2.1.0")
    else:
        password = self.get_password("password", self.username)
        self.bz = bugzilla.Bugzilla(url=url)
        self.bz.login(self.username, password)


# Traceback (KeyError)
Traceback (most recent call last):
File "/usr/local/bin/bugwarrior-pull", line 11, in <module>
load_entry_point('bugwarrior==1.5.1', 'console_scripts', 'bugwarrior-pull')()
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/bugwarrior-1.5.1-py2.7.egg/bugwarrior/command.py", line 73, in pull
synchronize(issue_generator, config, main_section, dry_run)
File "/usr/local/lib/python2.7/dist-packages/bugwarrior-1.5.1-py2.7.egg/bugwarrior/db.py", line 351, in synchronize
del issue_dict[field]
KeyError: u' description'

# Fixed code
def __init__(self, *args, **kw):
    super(BugzillaService, self).__init__(*args, **kw)
    self.base_uri = self.config.get("base_uri")
    self.username = self.config.get("username")
    self.ignore_cc = self.config.get(
        "ignore_cc", default=False, to_type=lambda x: x == "True"
    )
    self.query_url = self.config.get("query_url", default=None)
    self.include_needinfos = self.config.get(
        "include_needinfos", False, to_type=lambda x: x == "True"
    )
    self.open_statuses = self.config.get(
        "open_statuses", _open_statuses, to_type=aslist
    )
    log.debug(" filtering on statuses: %r", self.open_statuses)

    # So more modern bugzilla's require that we specify
    # query_format=advanced along with the xmlrpc request.
    # https://bugzilla.redhat.com/show_bug.cgi?id=825370
    # ...but older bugzilla's don't know anything about that argument.
    # Here we make it possible for the user to specify whether they want
    # to pass that argument or not.
    self.advanced = asbool(self.config.get("advanced", "no"))

    url = "https://%s/xmlrpc.cgi" % self.base_uri
    api_key = self.config.get("api_key", default=None)
    if api_key:
        try:
            self.bz = bugzilla.Bugzilla(url=url, api_key=api_key)
        except TypeError:
            raise Exception("Bugzilla API keys require python-bugzilla>=2.1.0")
    else:
        password = self.get_password("password", self.username)
        self.bz = bugzilla.Bugzilla(url=url)
        self.bz.login(self.username, password)