Skip to content

[BugzillaREST] requests.exceptions.HTTPError: 400 Client Error: Bad Request for url #875

@VolodymyrBiryuk

Description

@VolodymyrBiryuk

System information

  • Python 3.12.8
  • perceval==1.3.1

Issue description

When downloading Bugzilla data, the request fails with the error:

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://bugzilla.mozilla.org/rest/bug?last_change_time=2023-02-09T03%3A28%3A55Z&limit=25&order=changeddate&include_fields=_all&offset=25&api_key=<your-bugzilla-api-key>

When executing the URL in the browser, it returns an error as well, however if you increase the offset by amount x (in this example offset=40), it works again.

Steps to reproduce the issue

from perceval.backends.core.bugzillarest import BugzillaREST
from datetime import datetime

if __name__ == '__main__':
    init_args={
        'url': 'https://bugzilla.mozilla.org',
        'api_key': '<your-bugzilla-api-key>',
        'max_bugs': 25,
    }

    fetch_args={
        'from_date': datetime(2023, 1, 1)
    }

    backend = BugzillaREST(**init_args)
    iterator = backend.fetch(**fetch_args)
    for i, issue in enumerate(iterator):
        print('i')

What's the expected result?

  • The fetch function should increment offset by amount x until the request returns data again.
  • Or take offset as initial kwarg in the fetch function, so the users can skip it themselves.

What's the actual result?

  • The fetch function stops with an errro

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