snap-python icon indicating copy to clipboard operation
snap-python copied to clipboard

Neither SaveEdgeList nor DrawGViz support saving in directories other than current one

Open motiwari opened this issue 7 years ago • 3 comments

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.

motiwari avatar Jun 27 '18 21:06 motiwari

I expect that the problem is that the output path "data/G.txt" contains a directory and that "data" does not exist.

roks avatar Jun 29 '18 00:06 roks

Indeed, that fixed it - but shouldn't snap throw an error with that message instead of segfaulting?

motiwari avatar Jun 29 '18 00:06 motiwari

That is a good point. I reopened the issue.

roks avatar Jun 29 '18 02:06 roks