gak / pycallgraph

pycallgraph is a Python module that creates call graphs for Python programs.
GNU General Public License v2.0
1.83k stars 335 forks source link

Dot fails on cygwin with tmp file #97

Closed tontothefirst closed 12 years ago

tontothefirst commented 12 years ago

Hi there, i'm trying to generate a call graph using the command line on cygwin. However, I am receiving an error at the end of the process, when pycallgraph tries to generate the image.

This is specifically appearing as so

Error: dot: can't open /tmp/tmpIS7sUe
Caught exception, will raise after graph is made.
Creating pycallgraph.png
Error: dot: can't open /tmp/tmpSwnvAn
Traceback (most recent call last):
  File "/usr/bin/pycallgraph", line 161, in <module>
    pycallgraph.make_dot_graph(options.output_file, options.format, options.tool)
  File "/usr/lib/python2.6/site-packages/pycallgraph.py", line 386, in make_dot_graph
    'code %(ret)i.' % locals())
pycallgraph.PyCallGraphException: The command "dot -Tpng -opycallgraph.png /tmp/tmpSwnvAn" failed with error code 512.

My command line was approx

pycallgraph -- ./MACS-1.4.2/bin/macs14 -g 1.2e7 -t d1.txt -c d2.txt --name=S96cg

I have pycallgraph v0.5.1 and python v2.6.8 I would be very thankful if there is a solution to the problem that i'm facing, and i will try and see if i can find a fix in the meantime too !!

tontothefirst commented 12 years ago

I found out that this is not an issue with pycallgraph at all It is actually caused by my graphviz installation, which is win32, failing to use cygwin paths. I don't expect this kind of compatibility, even though it might be possible, so I'm closing this issue.

I am going to compile graphviz for cygwin to see if that works, but so far i have found a workaround Thanks

gak commented 12 years ago

Thanks for the report @tonto. Let me know how you go.

I don't think I have tested it on cygwin, so it'll be good to know if it works.