Skip to content

Infinite recursion with get_all_items #92

@jisantuc

Description

@jisantuc

When reading s3://rasterfoundry-development-data-us-east-1/berlin-catalog/catalog.json, initially, the reported links are correct:

> from pystac import Catalog
> catalog = Catalog.from_file("s3://rasterfoundry-development-data-us-east-1/berlin-catalog/catalog.json")
> catalog.links

[<Link rel=child target=./collection.json>,
 <Link rel=self target=s3://rasterfoundry-development-data-us-east-1/berlin-catalog/catalog.json>,
 <Link rel=root target=<Catalog id=berlin>>]

However, iterating over get_all_items throws a RecursionError: maximum recursion depth exceeded in comparison, and inspecting the links after the fact reveals that the catalog has picked up a child link to itself:

> catalog.links
[<Link rel=child target=<Catalog id=berlin>>,
 <Link rel=self target=s3://rasterfoundry-development-data-us-east-1/berlin-catalog/catalog.json>,
 <Link rel=parent target=<Catalog id=berlin>>,
 <Link rel=root target=<Catalog id=berlin>>]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThings which are broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions