Skip to content

IndexError: list index out of range during recursive validation on Windows #153

@nlebovits

Description

@nlebovits

Description

When using Linter with recursive=True on Windows, validation of nested STAC structures (catalog → collection → item) raises an IndexError instead of returning validation results.

Minimal Reproducible Example

Create these three files:

catalog.json:

{
  "type": "Catalog",
  "stac_version": "1.0.0",
  "id": "test-catalog",
  "description": "Test",
  "links": [
    {"rel": "root", "href": "./catalog.json", "type": "application/json"},
    {"rel": "child", "href": "./collection.json", "type": "application/json"}
  ]
}

collection.json:

{
  "type": "Collection",
  "stac_version": "1.0.0",
  "id": "test-collection",
  "description": "Test",
  "license": "CC0-1.0",
  "extent": {
    "spatial": {"bbox": [[-180, -90, 180, 90]]},
    "temporal": {"interval": [["2020-01-01T00:00:00Z", null]]}
  },
  "links": [
    {"rel": "root", "href": "./catalog.json", "type": "application/json"},
    {"rel": "item", "href": "./item.json", "type": "application/geo+json"}
  ]
}

item.json:

{
  "type": "Feature",
  "stac_version": "1.0.0",
  "id": "test-item",
  "geometry": {"type": "Point", "coordinates": [0, 0]},
  "bbox": [-1, -1, 1, 1],
  "properties": {"datetime": "2020-06-15T12:00:00Z"},
  "links": [],
  "assets": {}
}

test.py:

from stac_check.lint import Linter

linter = Linter(item="catalog.json", recursive=True)
print("valid_stac:", linter.valid_stac)
print("validate_all:", linter.validate_all)

Expected Behavior

Validation results for all nested objects (catalog, collection, item).

Actual Behavior

On Windows, validate_all contains entries with:

'error_type': 'IndexError'
'error_message': 'list index out of range'

Environment

  • stac-check version: 1.14.0
  • Platform: Windows (tested on GitHub Actions windows-latest)
  • Python: 3.10, 3.11, 3.12, 3.13

Notes

  • Works correctly on Linux and macOS
  • Non-recursive validation (recursive=False) works fine on Windows
  • Likely related to path handling differences between Windows and Unix

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