Skip to content

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

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

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