Skip to content

mirava command fails with FileNotFoundError for missing mirava_full_json.json #2

@ArmanTaheriGhaleTaki

Description

@ArmanTaheriGhaleTaki

Description

After successfully installing mirava-tui via pip, running the mirava command results in a FileNotFoundError because the required data file mirava_full_json.json is missing.

Steps to Reproduce

  1. Create and activate a virtual environment
  2. Install mirava-tui:
    pip install mirava-tui
  3. Run the mirava command:
    mirava

Expected Behavior

The application should either:

  • Ship with the required JSON file, or
  • Download it automatically (e.g., to ~/.config/mirava/ or ~/.local/share/mirava/) if missing

Actual Behavior

Traceback (most recent call last):
  File "/tmp/venv/bin/mirava", line 8, in <module>
    sys.exit(main())
  File "/tmp/venv/lib/python3.12/site-packages/mirava/cli.py", line 543, in main
    _main_inner()
  File "/tmp/venv/lib/python3.12/site-packages/mirava/cli.py", line 550, in _main_inner
    mirrors = load_mirrors("mirava_full_json.json")
  File "/tmp/venv/lib/python3.12/site-packages/mirava/mirrors.py", line 17, in load_mirrors
    with open(path, "r", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'mirava_full_json.json'

Environment

  • OS: Ubuntu 24.04.4 LTS
  • Python: 3.12
  • mirava-tui version: 0.1.2

Suggested Fix

The application should handle missing data files gracefully by:

  1. Checking if mirava_full_json.json exists in a standard location (e.g., ~/.config/mirava/, ~/.local/share/mirava/, or the package directory)
  2. Downloading the file automatically if not found
  3. Providing a clear error message with instructions if download fails

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