snap-python
snap-python copied to clipboard
Neither SaveEdgeList nor DrawGViz support saving in directories other than current one
The following code
import snap
G = snap.TUNGraph.New()
G.AddNode(1)
G.AddNode(2)
G.AddEdge(1,2)
snap.SaveEdgeList(G, "data/G.txt", "Save as tab-separated list of edges")
results in segmentation fault on macOS. Also a segfault if the last line is replaced with snap.DrawGViz(G, snap.gvlDot, 'data/G.txt', 'Test', True) . The segmentation fault occurs whenever saving in a directory other than the current one.
I expect that the problem is that the output path "data/G.txt" contains a directory and that "data" does not exist.
Indeed, that fixed it - but shouldn't snap throw an error with that message instead of segfaulting?
That is a good point. I reopened the issue.