Skip to content

include_fields in bz.getbug with string-named bug instead of id results in IndexError #170

Description

@frantisekz
bz = bugzilla.Bugzilla(url="bugzilla.redhat.com", api_key="key", force_rest=True)

bz.getbug(2135298) # works
bz.getbug(2135298, include_fields=["id"]) # works

bz.getbug("F37FinalBlocker") # works
bz.getbug("F37FinalBlocker", include_fields=["id"]) # broken:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Input In [9], in <cell line: 0>()
----> 1 bz.getbug("F37FinalBlocker", include_fields=["id"])

File /usr/lib/python3.11/site-packages/bugzilla/base.py:1129, in Bugzilla.getbug(self, objid, include_fields, exclude_fields, extra_fields)
   1123 def getbug(self, objid,
   1124            include_fields=None, exclude_fields=None, extra_fields=None):
   1125     """
   1126     Return a Bug object with the full complement of bug data
   1127     already loaded.
   1128     """
-> 1129     data = self._getbug(objid,
   1130         include_fields=include_fields, exclude_fields=exclude_fields,
   1131         extra_fields=extra_fields)
   1132     return Bug(self, dict=data, autorefresh=self.bug_autorefresh)

File /usr/lib/python3.11/site-packages/bugzilla/base.py:1121, in Bugzilla._getbug(self, objid, **kwargs)
   1112 def _getbug(self, objid, **kwargs):
   1113     """
   1114     Thin wrapper around _getbugs to handle the slight argument tweaks
   1115     for fetching a single bug. The main bit is permissive=False, which
   (...)
   1119     This logic is called from Bug() too
   1120     """
-> 1121     return self._getbugs([objid], permissive=False, **kwargs)[0]

IndexError: list index out of range

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions