Skip to content

IndexError: required_files[4] out of range in __main__.py (list has 4 items, indices 0-3) #144

Description

@chirag127

Problem

__main__.py crashes at startup with IndexError: list index out of range because required_files[4] is accessed on a 4-element list.

Steps

  1. git clone -b multi --single-branch https://github.com/Jxck-S/plane-notify.git && cd plane-notify
  2. pipenv install && pipenv run python __main__.py

Expected

Mictronics DB extraction proceeds after downloads.

Actual

Traceback (most recent call last):
  File "__main__.py", line 49, in <module>
    if os.path.isfile("./dependencies/" + required_files[4][0]) and not os.path.isfile("./dependencies/aircrafts.json"):
IndexError: list index out of range

required_files is defined at __main__.py:28-32 with 4 tuples (valid indices 0-3). Lines 49 and 52 reference required_files[4]; the intended target Mictronics_db.zip is at index [3].

Environment

Python 3.9 (per Pipfile python_version = "3.9"), branch multi, commit at default HEAD.

Fix: change required_files[4][0] to required_files[3][0] at __main__.py:49 and :52.

Thanks for maintaining Jxck-S/plane-notify!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions