Skip to content

wiki_graphify.py crashes on networkx < 3.4 - node_link_data edges= kwarg not supported #4

@DataBoyTX

Description

@DataBoyTX

Bug

`install.sh` aborts at Step 7 on systems with networkx < 3.4:

```
TypeError: node_link_data() got an unexpected keyword argument 'edges'
```

Root cause

`wiki_graphify.py` calls `nx.node_link_data(G, edges="edges")` but the
`edges=` keyword argument was only added in networkx 3.4. Systems with
networkx 3.2 or 3.3 (e.g. the version shipped with many conda environments)
will fail here every time.

Affected line: `src/wiki_graphify.py` ~L330

Fix

Guard with a try/except and rename the key manually on older installs:

```python
try:
graph_data = nx.node_link_data(G, edges="edges")
except TypeError:
graph_data = nx.node_link_data(G)
graph_data["edges"] = graph_data.pop("links", graph_data.get("edges", []))
```

Environment

  • claude-ctx 0.5.0rc4
  • networkx 3.2.1 (Python 3.12, conda)

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