Skip to content

Slicing a github.PaginatedList.PaginatedList can produce an IndexError #1

@mpiraux

Description

@mpiraux

Slicing a PaginatedList from PyGithub can produce an IndexError if the list is empty (while slicing an empty Python list do not). A few fixes can be envisaged:

  1. Check if the list is not empty before slicing and iterating over it - Not pythonic
  2. Monkey patch the PaginatedList class to properly re-implement slicing
  3. Open an issue and propose a PR to PyGithub

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions