My favorites | Sign in
Project Logo
                
Details: Show all Hide all

Last 30 days

  • Dec 13, 2009
    issue 17 (Error while trying to run example pydot script on dkbza.org) commented on by druths   -   I'd like to see this fixed ASAP as I have code that depends on it (and that needs to be deployed) - so I can't depend on other users having a modified version of pydot installed.
    I'd like to see this fixed ASAP as I have code that depends on it (and that needs to be deployed) - so I can't depend on other users having a modified version of pydot installed.
  • Dec 13, 2009
    issue 11 (Non-string attribute (int) values break pydot) commented on by druths   -   I've reproduced this error in the to_string() method of Edge. The problem is with the following line: edge_attr.append( attr + '=' + quote_if_necessary(value) ) This problem can be elegantly fixed by making quote_if_necessary(x) return 1) if x is a string, a quoted version of the 2) if x is a number, str(x) 3) if x is anything else, "%s" % str(x) This will both address the problem as well as allow light serialization of lists, dictionaries, and such into GraphViz fields.
    I've reproduced this error in the to_string() method of Edge. The problem is with the following line: edge_attr.append( attr + '=' + quote_if_necessary(value) ) This problem can be elegantly fixed by making quote_if_necessary(x) return 1) if x is a string, a quoted version of the 2) if x is a number, str(x) 3) if x is anything else, "%s" % str(x) This will both address the problem as well as allow light serialization of lists, dictionaries, and such into GraphViz fields.
  • Dec 07, 2009
    issue 17 (Error while trying to run example pydot script on dkbza.org) commented on by dgtlmoon   -   Works for me, can this be committed?
    Works for me, can this be committed?
  • Nov 25, 2009
    issue 28 (: included as value for any attribute causes error) commented on by oliner   -   Putting aside URLs for a moment, imagine that you have a huge collection of assorted strings that will be used as Node labels. If any one of them _might_ contain a colon, you need to wrap _all_ of my labels in escaped quotes. Not only does this increase the length of every label by two characters (which can matter with large graphs), but you need to add and strip those quotes whenever you move from pydot back to the original domain of strings. I appreciate that there is a workaround, but that workaround is (1) undocumented, (2) adds overhead to every node creation and label use, and (3) increases the length of the labels. This is a bug that deserves a proper solution.
    Putting aside URLs for a moment, imagine that you have a huge collection of assorted strings that will be used as Node labels. If any one of them _might_ contain a colon, you need to wrap _all_ of my labels in escaped quotes. Not only does this increase the length of every label by two characters (which can matter with large graphs), but you need to add and strip those quotes whenever you move from pydot back to the original domain of strings. I appreciate that there is a workaround, but that workaround is (1) undocumented, (2) adds overhead to every node creation and label use, and (3) increases the length of the labels. This is a bug that deserves a proper solution.
  • Nov 25, 2009
    issue 28 (: included as value for any attribute causes error) commented on by vparla   -   I've been able to add strings with colons, wrapping the string with quotes, like this: myString = "\"" + "http://www.google.com" + "\"" n = pydot.Node(myString) you have to put the quotes before you create the node, otherwise it doesn't work. It's kinda weird, but it works.
    I've been able to add strings with colons, wrapping the string with quotes, like this: myString = "\"" + "http://www.google.com" + "\"" n = pydot.Node(myString) you have to put the quotes before you create the node, otherwise it doesn't work. It's kinda weird, but it works.
  • Nov 25, 2009
    issue 28 (: included as value for any attribute causes error) commented on by vparla   -   I've been able to add strings with colons, wrapping the string with quotes, like this: myString = "\"" + "http://google.com" + "\"" n = pydot.Node(myString) you have to put the quotes before you create the node, otherwise it doesn't work. It's kinda weird, but it works.
    I've been able to add strings with colons, wrapping the string with quotes, like this: myString = "\"" + "http://google.com" + "\"" n = pydot.Node(myString) you have to put the quotes before you create the node, otherwise it doesn't work. It's kinda weird, but it works.

Earlier this year

  • Oct 14, 2009
    issue 17 (Error while trying to run example pydot script on dkbza.org) commented on by simon.knight   -   Thanks for the patch! I also had to do the following (I am using pydot with Networkx): diff pydot-1.0.2/pydot.py pydot-1.0.2_patched/pydot.py 237,238c237,238 < e = Edge( node_prefix + edge[0], node_prefix + edge[1] ) < graph.add_edge(e) --- > e = Edge( node_prefix + str(edge[0]), node_prefix + str(edge[1]) ) > graph.add_edge(e) 900c900 < edge_attr.append( attr + '=' + quote_if_necessary(value) ) --- > edge_attr.append( attr + '=' + str(quote_if_necessary(value)) )
    Thanks for the patch! I also had to do the following (I am using pydot with Networkx): diff pydot-1.0.2/pydot.py pydot-1.0.2_patched/pydot.py 237,238c237,238 < e = Edge( node_prefix + edge[0], node_prefix + edge[1] ) < graph.add_edge(e) --- > e = Edge( node_prefix + str(edge[0]), node_prefix + str(edge[1]) ) > graph.add_edge(e) 900c900 < edge_attr.append( attr + '=' + quote_if_necessary(value) ) --- > edge_attr.append( attr + '=' + str(quote_if_necessary(value)) )
  • Oct 01, 2009
    issue 32 (Are there plans to port pydot to Python 3.x) reported by salimfadhley   -   The python-graph team are working on porting our project to Python 3.x - naturally we'd like to retain our support for pydot. Can any member of this project comment if a python 3.x version is likely in the near future. Thanks!
    The python-graph team are working on porting our project to Python 3.x - naturally we'd like to retain our support for pydot. Can any member of this project comment if a python 3.x version is likely in the near future. Thanks!
  • Jul 19, 2009
    issue 29 (find_graphviz() fails on Windows when no registry entry pres...) commented on by hans.don...@pobox.com   -   thanks for the patch
    thanks for the patch
  • Jul 14, 2009
    issue 29 (find_graphviz() fails on Windows when no registry entry pres...) commented on by jubajube   -   Attached is a patch to 1.0.2 that fixes these problems.
    Attached is a patch to 1.0.2 that fixes these problems.
  • Jul 13, 2009
    issue 21 (Does this work with Python 2.6?) commented on by abbconsulting   -   The same applies for Python 3.1.
    The same applies for Python 3.1.
  • Jul 07, 2009
    issue 31 (get_subgraph function has a bug) commented on by chris.felton   -   There is already a defect entry for this issue. This defect is a duplicate.
    There is already a defect entry for this issue. This defect is a duplicate.
  • Jul 07, 2009
    issue 31 (get_subgraph function has a bug) reported by chris.felton   -   What steps will reproduce the problem? 1. Call the get_subgraph function What is the expected output? What do you see instead? The expected output is a return type of Subgraph. The current issue is a simple coding bug. But I don't believe the implementation is correct. What version of the product are you using? On what operating system? 1.02 Please provide any additional information below. Here is the function fixed so that it doesn't fail. As mentioned in the discussion group, I believe the subgraph functions as a whole need to be reviewed. The subgraphs are being reconstructed incorrectly. --------------------------------------------------------------------------- def get_subgraph(self, name): match = [] if self.obj_dict['subgraphs'].has_key( name ): sgraphs_obj_dict = self.obj_dict['subgraphs'].get( name ) for obj_dict_list in sgraphs_obj_dict: match = [ Subgraph( obj_dict = obj_d ) for obj_d in obj_dict_list ] if len(match)==1: return match[0] return match ---------------------------------------------------------------------------
    What steps will reproduce the problem? 1. Call the get_subgraph function What is the expected output? What do you see instead? The expected output is a return type of Subgraph. The current issue is a simple coding bug. But I don't believe the implementation is correct. What version of the product are you using? On what operating system? 1.02 Please provide any additional information below. Here is the function fixed so that it doesn't fail. As mentioned in the discussion group, I believe the subgraph functions as a whole need to be reviewed. The subgraphs are being reconstructed incorrectly. --------------------------------------------------------------------------- def get_subgraph(self, name): match = [] if self.obj_dict['subgraphs'].has_key( name ): sgraphs_obj_dict = self.obj_dict['subgraphs'].get( name ) for obj_dict_list in sgraphs_obj_dict: match = [ Subgraph( obj_dict = obj_d ) for obj_d in obj_dict_list ] if len(match)==1: return match[0] return match ---------------------------------------------------------------------------
  • Jul 06, 2009
    issue 24 (pydot does not support unicode) commented on by spotrh   -   As I am not an expert in Python unicode issues, I asked someone who was to take a look at this issue, and this was his (Toshio Kuratomi's) reply: --- Comment #3 from Toshio Ernie Kuratomi <a.badger@gmail.com> 2009-05-29 03:26:44 EDT --- This one looks like it isn't a bug to me. Rather, it's a request for an API change. Right now, pydot accepts str type. It does not accept unicode type. So the user is forced to change the unicode strings that they have into byte strings before sending it into a pydot function. That's why n1.encode('UTF-8') is necessary. This makes some sense as pydot must interact with the world outside of python in the form of the /usr/bin/dot command. pydot communicates with that command by writing the information for /usr/bin/dot to a temporary file and then having /usr/bin/dot operate on that file. In order to create the temporary file, pydot must deal in byte strings (str). In the current code, the user gives pydot byte strings and pydot writes those out directly to the file. The user performs the conversion from unicode type to utf-8 encoded byte string. In order for pydot to handle unicode strings instead of byte strings, it would need to make the conversion that the user is currently doing. That shouldn't be too hard as /usr/bin/dot will accept utf-8 and all unicode strings can be encoded to utf-8. However, for sanity of the pydot upstream, pydot probably should stop accepting byte strings when it makes this switch. So end-user code similar to this will start to fail: g.add_edge(pydot.Edge('Th\xe9r\xe8se Doe')) If pydot upstream chooses to accept both byte strings and unicode type, it will have to take into account what happens when the user provides byte strings that are not valid utf-8 and also unicode strings. If they aren't careful, pydot will get confused about what it needs to do in this situation and either crash or output garbage. Making this sort of API change should only be done by upstream.
    As I am not an expert in Python unicode issues, I asked someone who was to take a look at this issue, and this was his (Toshio Kuratomi's) reply: --- Comment #3 from Toshio Ernie Kuratomi <a.badger@gmail.com> 2009-05-29 03:26:44 EDT --- This one looks like it isn't a bug to me. Rather, it's a request for an API change. Right now, pydot accepts str type. It does not accept unicode type. So the user is forced to change the unicode strings that they have into byte strings before sending it into a pydot function. That's why n1.encode('UTF-8') is necessary. This makes some sense as pydot must interact with the world outside of python in the form of the /usr/bin/dot command. pydot communicates with that command by writing the information for /usr/bin/dot to a temporary file and then having /usr/bin/dot operate on that file. In order to create the temporary file, pydot must deal in byte strings (str). In the current code, the user gives pydot byte strings and pydot writes those out directly to the file. The user performs the conversion from unicode type to utf-8 encoded byte string. In order for pydot to handle unicode strings instead of byte strings, it would need to make the conversion that the user is currently doing. That shouldn't be too hard as /usr/bin/dot will accept utf-8 and all unicode strings can be encoded to utf-8. However, for sanity of the pydot upstream, pydot probably should stop accepting byte strings when it makes this switch. So end-user code similar to this will start to fail: g.add_edge(pydot.Edge('Th\xe9r\xe8se Doe')) If pydot upstream chooses to accept both byte strings and unicode type, it will have to take into account what happens when the user provides byte strings that are not valid utf-8 and also unicode strings. If they aren't careful, pydot will get confused about what it needs to do in this situation and either crash or output garbage. Making this sort of API change should only be done by upstream.
  • Jul 06, 2009
    issue 23 (pydot crashes with character with accent) commented on by spotrh   -   This issue can be resolved with the attached patch, written by Toshio Kuratomi <a.badger@gmail.com>.
    This issue can be resolved with the attached patch, written by Toshio Kuratomi <a.badger@gmail.com>.
  • Jun 21, 2009
    issue 24 (pydot does not support unicode) commented on by ruxkor   -   i didn't check the code, but i needed to add quotes explicitely to my unicode strings in order to use them with pydot, like this: x = u'my unicöde var' myNode.set_label('"'+x.encode('utf-8')+'"')
    i didn't check the code, but i needed to add quotes explicitely to my unicode strings in order to use them with pydot, like this: x = u'my unicöde var' myNode.set_label('"'+x.encode('utf-8')+'"')
  • Jun 05, 2009
    issue 13 (get_node_list returns empty list on graphs with more than on...) commented on by adewale   -   I've attached a patch, with tests, which fixes this issue. It checks that when building a graph using pydot.graph_from_edges() we add the nodes into the graph if they haven't already been added. It might be a better idea to change the add_edge method so that it always adds the 2 nodes if they don't already exist. However that's a change with more side-effects and I didn't want to risk it in my first patch to the project. Consequently this patch only fixes one of the convenience methods for building a graph. The other convenience methods will all still exhibit the same bug.
    I've attached a patch, with tests, which fixes this issue. It checks that when building a graph using pydot.graph_from_edges() we add the nodes into the graph if they haven't already been added. It might be a better idea to change the add_edge method so that it always adds the 2 nodes if they don't already exist. However that's a change with more side-effects and I didn't want to risk it in my first patch to the project. Consequently this patch only fixes one of the convenience methods for building a graph. The other convenience methods will all still exhibit the same bug.
  • Jun 04, 2009
    issue 13 (get_node_list returns empty list on graphs with more than on...) commented on by adewale   -   The method: graph_from_edges() is broken. It only updates the edge_list. It doesn't update the node_list. If you change your code to build your own nodes and edges using graph.add_node() and graph.add_edge() then everything behaves properly.
    The method: graph_from_edges() is broken. It only updates the edge_list. It doesn't update the node_list. If you change your code to build your own nodes and edges using graph.add_node() and graph.add_edge() then everything behaves properly.
  • May 29, 2009
    issue 16 (attributes missing from Dot) commented on by oliner   -   This is almost a "me too," but I want to add that it is not only the Dot class that generates this error. Node, for example, is also unpickleable: "AttributeError: 'Node' object has no attribute 'attributes'"
    This is almost a "me too," but I want to add that it is not only the Dot class that generates this error. Node, for example, is also unpickleable: "AttributeError: 'Node' object has no attribute 'attributes'"
  • May 16, 2009
    issue 30 (get_subgraphs() and get_subgraph() broken in 1.0.2) reported by a...@insectnation.org   -   What steps will reproduce the problem? 1. Run the following (or similar) interactive Python session: >>> import pydot >>> g = pydot.Graph() >>> s = pydot.Subgraph("foo") >>> g.get_subgraphs() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/var/lib/python-support/python2.6/pydot.py", line 1345, in get_subgraphs return get_subgraph_list() NameError: global name 'get_subgraph_list' is not defined >>> g.get_subgraph_list() [] >>> sgs = g.add_subgraph(s) >>> g.get_subgraphs() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/var/lib/python-support/python2.6/pydot.py", line 1345, in get_subgraphs return get_subgraph_list() NameError: global name 'get_subgraph_list' is not defined >>> g.get_subgraph_list() [<pydot.Subgraph object at 0xa279d2c>] >>> g.get_subgraph("foo") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/var/lib/python-support/python2.6/pydot.py", line 1330, in get_subgraph if self.obj_dict['subgraphs'].has_key( sgraph.get_name() ): NameError: global name 'sgraph' is not defined What is the expected output? What do you see instead? There are global name problems in the implementations of the Graph.get_subgraphs() and Graph.get_subgraph(<name>) functions. This may just be a case of having forgotten to include the "self" argument, which has skipped by testing if the tests don't use subgraphs. What version of the product are you using? On what operating system? I'm using the system package of pydot on Ubuntu 9.04 (Jaunty) >>> pydot.__version__ '1.0.2'
    What steps will reproduce the problem? 1. Run the following (or similar) interactive Python session: >>> import pydot >>> g = pydot.Graph() >>> s = pydot.Subgraph("foo") >>> g.get_subgraphs() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/var/lib/python-support/python2.6/pydot.py", line 1345, in get_subgraphs return get_subgraph_list() NameError: global name 'get_subgraph_list' is not defined >>> g.get_subgraph_list() [] >>> sgs = g.add_subgraph(s) >>> g.get_subgraphs() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/var/lib/python-support/python2.6/pydot.py", line 1345, in get_subgraphs return get_subgraph_list() NameError: global name 'get_subgraph_list' is not defined >>> g.get_subgraph_list() [<pydot.Subgraph object at 0xa279d2c>] >>> g.get_subgraph("foo") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/var/lib/python-support/python2.6/pydot.py", line 1330, in get_subgraph if self.obj_dict['subgraphs'].has_key( sgraph.get_name() ): NameError: global name 'sgraph' is not defined What is the expected output? What do you see instead? There are global name problems in the implementations of the Graph.get_subgraphs() and Graph.get_subgraph(<name>) functions. This may just be a case of having forgotten to include the "self" argument, which has skipped by testing if the tests don't use subgraphs. What version of the product are you using? On what operating system? I'm using the system package of pydot on Ubuntu 9.04 (Jaunty) >>> pydot.__version__ '1.0.2'
  • May 06, 2009
    issue 28 (: included as value for any attribute causes error) commented on by oliner   -   This is really an unsatisfactory solution. If the variable 'name' above contained a colon, the name would be truncated at that character: >>> myname = "kept:lost" >>> n = pydot.Node(myname) >>> n.get_name() 'kept' I shouldn't need to perform a deep inspection of my strings to weed out colons. That is, I shouldn't have to perform a colonoscopy. Do we have any alternatives? Is there any way to change the separator character?
    This is really an unsatisfactory solution. If the variable 'name' above contained a colon, the name would be truncated at that character: >>> myname = "kept:lost" >>> n = pydot.Node(myname) >>> n.get_name() 'kept' I shouldn't need to perform a deep inspection of my strings to weed out colons. That is, I shouldn't have to perform a colonoscopy. Do we have any alternatives? Is there any way to change the separator character?
  • May 04, 2009
    issue 24 (pydot does not support unicode) commented on by msbranco   -   Indeed useful (am doing my thesis diagrams with PyDot and the greek alphabet is useful to represent). Let me know if I can help; not a unicode expert at all...
    Indeed useful (am doing my thesis diagrams with PyDot and the greek alphabet is useful to represent). Let me know if I can help; not a unicode expert at all...
  • Apr 30, 2009
    issue 29 (find_graphviz() fails on Windows when no registry entry pres...) commented on by phrrngtn   -   FYI: The registry key used by a recent install is: "SOFTWARE\AT&T Research Labs\Graphviz" note that 'ATT' has changed to 'AT&T Research Labs'
    FYI: The registry key used by a recent install is: "SOFTWARE\AT&T Research Labs\Graphviz" note that 'ATT' has changed to 'AT&T Research Labs'
  • Apr 22, 2009
    issue 29 (find_graphviz() fails on Windows when no registry entry pres...) reported by kn...@mac.com   -   What steps will reproduce the problem? 1. Install Graphviz on Windows. 2. If it was created then remove the SOFTWARE\ATT\Graphviz key from the registry. 3. import pydot; pydot.find_graphviz() What is the expected output? What do you see instead? I would expect the registry check to fail and for the code to fall back to checking paths. Instead, an (C++?) exception is raised when calling win32api.RegOpenKeyEx(...). What version of the product are you using? On what operating system? pydot 1.0.2, Graphviz 2.22.2 (?) on Windows XP Please provide any additional information below. The following alternate "Method 1" for find_graphviz() that uses winreg/_winreg appears to work: # Method 1 (Windows only) # if os.sys.platform == 'win32': # Get the GraphViz install path from the registry # try: import winreg # Python 3.0+ except: try: import _winreg as winreg # Python 2.0+ except: winreg = None if winreg is not None: hkey = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) try: gvkey = winreg.OpenKey(hkey, "SOFTWARE\\ATT\\Graphviz", 0, winreg.KEY_READ) if gvkey is not None: path = winreg.QueryValueEx(gvkey, "InstallPath")[0] if path is not None: progs = __find_executables(path + os.sep + "bin") if progs is not None : #print "Used Windows registry" return progs except: pass finally: winreg.CloseKey(hkey)
    What steps will reproduce the problem? 1. Install Graphviz on Windows. 2. If it was created then remove the SOFTWARE\ATT\Graphviz key from the registry. 3. import pydot; pydot.find_graphviz() What is the expected output? What do you see instead? I would expect the registry check to fail and for the code to fall back to checking paths. Instead, an (C++?) exception is raised when calling win32api.RegOpenKeyEx(...). What version of the product are you using? On what operating system? pydot 1.0.2, Graphviz 2.22.2 (?) on Windows XP Please provide any additional information below. The following alternate "Method 1" for find_graphviz() that uses winreg/_winreg appears to work: # Method 1 (Windows only) # if os.sys.platform == 'win32': # Get the GraphViz install path from the registry # try: import winreg # Python 3.0+ except: try: import _winreg as winreg # Python 2.0+ except: winreg = None if winreg is not None: hkey = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) try: gvkey = winreg.OpenKey(hkey, "SOFTWARE\\ATT\\Graphviz", 0, winreg.KEY_READ) if gvkey is not None: path = winreg.QueryValueEx(gvkey, "InstallPath")[0] if path is not None: progs = __find_executables(path + os.sep + "bin") if progs is not None : #print "Used Windows registry" return progs except: pass finally: winreg.CloseKey(hkey)
  • Mar 31, 2009
    issue 28 (: included as value for any attribute causes error) commented on by kevin.manley   -   Make sure the URL is in quotes in the dot file, e.g. node = pydot.Node(nodeid, label=name, shape="rect", style="filled", fillcolor="green", URL=('"http://%s:40000/job?guid=%s"' % (self.grid, self.resultcache[name]))) Note the extra quotes
    Make sure the URL is in quotes in the dot file, e.g. node = pydot.Node(nodeid, label=name, shape="rect", style="filled", fillcolor="green", URL=('"http://%s:40000/job?guid=%s"' % (self.grid, self.resultcache[name]))) Note the extra quotes
  • Mar 24, 2009
    issue 28 (: included as value for any attribute causes error) reported by divyaS15   -   Whenever a colon(:) occurs in the value field of any of the attributes, pydot throws an error. Please someone fix this as soon as possible. It is very likely to have ":" in the value provided to the URL attribute. In my case I tried to create a node with URL='http:// www.google.com' but unfortunately this does not work. If I remove the colon i.e give URL='http//www.google.com', it works without any error but that doesn't serve the purpose. So it needs to be handled.
    Whenever a colon(:) occurs in the value field of any of the attributes, pydot throws an error. Please someone fix this as soon as possible. It is very likely to have ":" in the value provided to the URL attribute. In my case I tried to create a node with URL='http:// www.google.com' but unfortunately this does not work. If I remove the colon i.e give URL='http//www.google.com', it works without any error but that doesn't serve the purpose. So it needs to be handled.
  • Feb 17, 2009
    issue 27 (simplify bug) reported by willi.richert   -   simplify=True does not work because class Edge does not provide an appropriate __hash__ function, so that the test if self.obj_dict.get('simplify', False) and edge in edges_done: continue tests only for reference identify. This patch helps: 836a835,836 > def __hash__(self): > return hash(self.get_source()+self.get_destination()) 1457,1458c1457,1458 < < if self.obj_dict.get('simplify', False) and elm in edges_done: --- > > if self.obj_dict.get('simplify', False) and edge in edges_done:
    simplify=True does not work because class Edge does not provide an appropriate __hash__ function, so that the test if self.obj_dict.get('simplify', False) and edge in edges_done: continue tests only for reference identify. This patch helps: 836a835,836 > def __hash__(self): > return hash(self.get_source()+self.get_destination()) 1457,1458c1457,1458 < < if self.obj_dict.get('simplify', False) and elm in edges_done: --- > > if self.obj_dict.get('simplify', False) and edge in edges_done:
  • Feb 17, 2009
    issue 26 (Inconsitent parameter specification) reported by willi.richert   -   This works: pydot.Dot(rankdir="LR", overlap="False", graph_type='digraph', simplify=True) This works not: pydot.Dot(rankdir="LR", overlap=False, graph_type='digraph', simplify=True) File "file.py", line 374, in function dot.write_svg(directory+'/region_graph_%s.svg'%name, prog='neato') File "/var/lib/python-support/python2.5/pydot.py", line 1602, in <lambda> lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog)) File "/var/lib/python-support/python2.5/pydot.py", line 1696, in write dot_fd.write(self.create(prog, format)) File "/var/lib/python-support/python2.5/pydot.py", line 1740, in create self.write(tmp_name) File "/var/lib/python-support/python2.5/pydot.py", line 1694, in write dot_fd.write(self.to_string()) File "/var/lib/python-support/python2.5/pydot.py", line 1472, in to_string return ''.join(graph) TypeError: sequence item 5: expected string, bool found Why not allowing the natural data types?
    This works: pydot.Dot(rankdir="LR", overlap="False", graph_type='digraph', simplify=True) This works not: pydot.Dot(rankdir="LR", overlap=False, graph_type='digraph', simplify=True) File "file.py", line 374, in function dot.write_svg(directory+'/region_graph_%s.svg'%name, prog='neato') File "/var/lib/python-support/python2.5/pydot.py", line 1602, in <lambda> lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog)) File "/var/lib/python-support/python2.5/pydot.py", line 1696, in write dot_fd.write(self.create(prog, format)) File "/var/lib/python-support/python2.5/pydot.py", line 1740, in create self.write(tmp_name) File "/var/lib/python-support/python2.5/pydot.py", line 1694, in write dot_fd.write(self.to_string()) File "/var/lib/python-support/python2.5/pydot.py", line 1472, in to_string return ''.join(graph) TypeError: sequence item 5: expected string, bool found Why not allowing the natural data types?
  • Feb 14, 2009
    issue 25 (Creating DOT nodes in subgraph with rank=same) reported by anyoneus...@yahoo.com   -   What steps will reproduce the problem? 1. File attached - direct DOT text file works fine on simple test graph 2. Occurs when attempting to create table-like structure using multiple node lines with rank=same. Works fine in direct DOT calls (where I'm using much more complex structures including embedded clusters and subgraphs). 3. I've remove all comment lines to make sure they were not triggering the problem (although I can't image why, it shortens the file). What is the expected output? What do you see instead? Instead of two lines of nodes, I receive a single long row. The subgraphs are not maintaining their independencies. Let me know if you need additional information/data. What version of the product are you using? On what operating system? XP-SP3, DOT 2.21, pydot 1.02, Python 2.5, IDLE (python's standard IDE) for testing purposes (to keep it simple). Please provide any additional information below. - Objective - create multi-tier embedded table structure using pydot. I can do this in DOT (directly, see attached sample). - Objective - add distance values to edges which can be used in least-distance calculations. - Objective - create cluster structures as supported in DOT. Suggestions (class extensions): - support for Cluster function which is very useful in DOT. - add_edge_list (not the graph_from_edge, but a full list of tuples) - add_node_list (list with attributes) - add_edge_chain - ordered list where each member is assumed to be linked to the next member in the list. This is supported in DOT. - add_edge_matrix(self, list_edges, length_subchain, status_links_bidirectional) - ordered list that creates table-like grid where automatic links are generated between vertical pairs and horizontal pairs. For example, if a list of 12 members (essentially 4 rows of 3 members) is passed, used the length_subchain (in this case 3) to parse out horizontal edges. If status_links_bidirectional==True, then link each row (neighbor)member with the member in the row above it (so row 2, position 2 would link to row 1, position 2 and row 3, position 2) without having to explicitly map out each each.
    What steps will reproduce the problem? 1. File attached - direct DOT text file works fine on simple test graph 2. Occurs when attempting to create table-like structure using multiple node lines with rank=same. Works fine in direct DOT calls (where I'm using much more complex structures including embedded clusters and subgraphs). 3. I've remove all comment lines to make sure they were not triggering the problem (although I can't image why, it shortens the file). What is the expected output? What do you see instead? Instead of two lines of nodes, I receive a single long row. The subgraphs are not maintaining their independencies. Let me know if you need additional information/data. What version of the product are you using? On what operating system? XP-SP3, DOT 2.21, pydot 1.02, Python 2.5, IDLE (python's standard IDE) for testing purposes (to keep it simple). Please provide any additional information below. - Objective - create multi-tier embedded table structure using pydot. I can do this in DOT (directly, see attached sample). - Objective - add distance values to edges which can be used in least-distance calculations. - Objective - create cluster structures as supported in DOT. Suggestions (class extensions): - support for Cluster function which is very useful in DOT. - add_edge_list (not the graph_from_edge, but a full list of tuples) - add_node_list (list with attributes) - add_edge_chain - ordered list where each member is assumed to be linked to the next member in the list. This is supported in DOT. - add_edge_matrix(self, list_edges, length_subchain, status_links_bidirectional) - ordered list that creates table-like grid where automatic links are generated between vertical pairs and horizontal pairs. For example, if a list of 12 members (essentially 4 rows of 3 members) is passed, used the length_subchain (in this case 3) to parse out horizontal edges. If status_links_bidirectional==True, then link each row (neighbor)member with the member in the row above it (so row 2, position 2 would link to row 1, position 2 and row 3, position 2) without having to explicitly map out each each.
  • Feb 03, 2009
    issue 24 (pydot does not support unicode) reported by spotrh   -   What steps will reproduce the problem? import pydot n1 = u"Thérèse Doe" n2 = u"Jean-Pierre Toué" # Does not work g = pydot.Dot() g.add_edge(pydot.Edge(n1, n2)) g.write_jpeg('test.jpg') # Works :) g = pydot.Dot() g.add_edge(pydot.Edge(n1.encode('UTF-8'), n2.encode('UTF-8'))) g.write_jpeg('test.jpg') What version of the product are you using? On what operating system? 1.0.2, on Fedora 10. Please provide any additional information below. Originally filed here: https://bugzilla.redhat.com/show_bug.cgi?id=481786
    What steps will reproduce the problem? import pydot n1 = u"Thérèse Doe" n2 = u"Jean-Pierre Toué" # Does not work g = pydot.Dot() g.add_edge(pydot.Edge(n1, n2)) g.write_jpeg('test.jpg') # Works :) g = pydot.Dot() g.add_edge(pydot.Edge(n1.encode('UTF-8'), n2.encode('UTF-8'))) g.write_jpeg('test.jpg') What version of the product are you using? On what operating system? 1.0.2, on Fedora 10. Please provide any additional information below. Originally filed here: https://bugzilla.redhat.com/show_bug.cgi?id=481786
  • Feb 03, 2009
    issue 23 (pydot crashes with character with accent) reported by spotrh   -   What steps will reproduce the problem? import pydot g = pydot.Dot() g.add_node(pydot.Node("Anne-Cécile")) g.add_edge(pydot.Edge(src='Anne-Cécile', dst='Anne-Marie')) g.write('test.jpg', format='raw') g.write_jpeg('test.jpg') What is the expected output? What do you see instead? >>> g.write_jpeg('test.jpg') True What do you see instead? >>> g.write_jpeg('test.jpg') Anne-Cécile [195, 169] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.5/site-packages/pydot.py", line 1603, in <lambda> lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog)) File "/usr/lib/python2.5/site-packages/pydot.py", line 1697, in write dot_fd.write(self.create(prog, format)) File "/usr/lib/python2.5/site-packages/pydot.py", line 1797, in create status, stderr_output) ) pydot.InvocationException: Program terminated with status: 6. stderr follows: Error: /tmp/tmpVEABbQ:2: syntax error near line 2 context: >>> Anne- <<< Cécile; What version of the product are you using? On what operating system? 1.0.2 on Fedora 10 (also occurs in Rawhide) Please provide any additional information below. Originally filed here: https://bugzilla.redhat.com/show_bug.cgi?id=481540
    What steps will reproduce the problem? import pydot g = pydot.Dot() g.add_node(pydot.Node("Anne-Cécile")) g.add_edge(pydot.Edge(src='Anne-Cécile', dst='Anne-Marie')) g.write('test.jpg', format='raw') g.write_jpeg('test.jpg') What is the expected output? What do you see instead? >>> g.write_jpeg('test.jpg') True What do you see instead? >>> g.write_jpeg('test.jpg') Anne-Cécile [195, 169] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.5/site-packages/pydot.py", line 1603, in <lambda> lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog)) File "/usr/lib/python2.5/site-packages/pydot.py", line 1697, in write dot_fd.write(self.create(prog, format)) File "/usr/lib/python2.5/site-packages/pydot.py", line 1797, in create status, stderr_output) ) pydot.InvocationException: Program terminated with status: 6. stderr follows: Error: /tmp/tmpVEABbQ:2: syntax error near line 2 context: >>> Anne- <<< Cécile; What version of the product are you using? On what operating system? 1.0.2 on Fedora 10 (also occurs in Rawhide) Please provide any additional information below. Originally filed here: https://bugzilla.redhat.com/show_bug.cgi?id=481540
  • Feb 01, 2009
    issue 22 (Windows binary request) commented on by abbconsulting   -   Okay. That's fine.
    Okay. That's fine.
  • Feb 01, 2009
    issue 22 (Windows binary request) Status changed by ero.carrera   -  
    Status: Invalid
    Status: Invalid
  • Feb 01, 2009
    issue 22 (Windows binary request) commented on by ero.carrera   -   I don't understand exactly what you mean with this. It's as simple as doing a "easy_install" or "python setup.py install" on the code. That's the standard way of installing Python packages. I don't think an "installation binary" is appropriate for a module like this one.
    I don't understand exactly what you mean with this. It's as simple as doing a "easy_install" or "python setup.py install" on the code. That's the standard way of installing Python packages. I don't think an "installation binary" is appropriate for a module like this one.
  • Jan 30, 2009
    issue 22 (Windows binary request) reported by abbconsulting   -   Can a Windows installation binary be made for this?
    Can a Windows installation binary be made for this?
  • Jan 30, 2009
    issue 21 (Does this work with Python 2.6?) reported by abbconsulting   -   Can this be tested with Python 2.6 to ensure it works?
    Can this be tested with Python 2.6 to ensure it works?
  • Jan 28, 2009
    issue 19 (Problem with detecting path to GraphViz) reported by dmitrii.ignatov   -   I have a problem with finding of path to GraphViz system in pydot module version 1.0.2. GraphVis catalog is "C:\Program Files\Graphviz 2.21\bin" by default, but function find_graphvis() returned "None" value. It just because there was "C:\Program Files\ATT\Graphviz\bin" as a default path to binaries. Solving of problem is such # Method 3 (Windows only) # if os.sys.platform == 'win32': print 'win32' # Try and work out the equivalent of "C:\Program Files" on this # machine (might be on drive D:, or in a different language) # if os.environ.has_key('PROGRAMFILES'): # Note, we could also use the win32api to get this # information, but win32api may not be installed. #path = os.path.join(os.environ ['PROGRAMFILES'], 'ATT', 'GraphViz', 'bin') #print path #else: #Just in case, try the default... path = r"C:\Program Files\Graphviz 2.21\bin" print path progs = __find_executables(path) print progs if progs is not None : #print "Used default install location" return progs
    I have a problem with finding of path to GraphViz system in pydot module version 1.0.2. GraphVis catalog is "C:\Program Files\Graphviz 2.21\bin" by default, but function find_graphvis() returned "None" value. It just because there was "C:\Program Files\ATT\Graphviz\bin" as a default path to binaries. Solving of problem is such # Method 3 (Windows only) # if os.sys.platform == 'win32': print 'win32' # Try and work out the equivalent of "C:\Program Files" on this # machine (might be on drive D:, or in a different language) # if os.environ.has_key('PROGRAMFILES'): # Note, we could also use the win32api to get this # information, but win32api may not be installed. #path = os.path.join(os.environ ['PROGRAMFILES'], 'ATT', 'GraphViz', 'bin') #print path #else: #Just in case, try the default... path = r"C:\Program Files\Graphviz 2.21\bin" print path progs = __find_executables(path) print progs if progs is not None : #print "Used default install location" return progs
  • Jan 22, 2009
    issue 12 (Example some wrong with version 1.0.2) commented on by jordan.share   -   0.9.10 was using str() to convert the tuple members to strings before concatenating them with node_prefix. For unknown reasons, 1.0.2 was changed to no longer convert to string. You can only use strings in the tuples.
    0.9.10 was using str() to convert the tuple members to strings before concatenating them with node_prefix. For unknown reasons, 1.0.2 was changed to no longer convert to string. You can only use strings in the tuples.

Older

  • Dec 24, 2008
    issue 18 (Graph.get_edge() has several bugs... more below) reported by VirtualThoughts   -   1: When adding an edge to a Graph via add_edge(Edge('foo', 'bar')) the key value that ends up in the obj_dict['edges'] dictionary is not the ('foo', 'bar') pair, but rather the following: ('"foo"', '"bar"') This causes me to have to do something silly when using the get_edge function such as: Graph.get_edge('"%s"'%src, '"%s"'%dst) in order for it to create ('"foo"', '"bar"') internally and actually find the edge i'm looking for. 2: The documentation for get_edge() in incorrect. It states: """Retrieved an edge from the graph. Given an edge's source and destination the corresponding Edge instance will be returned. If multiple edges exist with that source and destination, a list of Edge instances is returned. If only one edge exists, the instance is returned. None is returned otherwise. """ However in the code there is no place where None is actually returned: snippet: if len(match)==1: return match[0] return match should be: if len(match)==0: return None elif len(match)==1: return match[0] return match 3: It would be nice if get_edge always returned an Edge or always returned a list of Edges, but by being able to return both it requires users code to check what it actually got in return. If you simply returned a list of Edges then it is easy for the user to check for None or len() of 1
    1: When adding an edge to a Graph via add_edge(Edge('foo', 'bar')) the key value that ends up in the obj_dict['edges'] dictionary is not the ('foo', 'bar') pair, but rather the following: ('"foo"', '"bar"') This causes me to have to do something silly when using the get_edge function such as: Graph.get_edge('"%s"'%src, '"%s"'%dst) in order for it to create ('"foo"', '"bar"') internally and actually find the edge i'm looking for. 2: The documentation for get_edge() in incorrect. It states: """Retrieved an edge from the graph. Given an edge's source and destination the corresponding Edge instance will be returned. If multiple edges exist with that source and destination, a list of Edge instances is returned. If only one edge exists, the instance is returned. None is returned otherwise. """ However in the code there is no place where None is actually returned: snippet: if len(match)==1: return match[0] return match should be: if len(match)==0: return None elif len(match)==1: return match[0] return match 3: It would be nice if get_edge always returned an Edge or always returned a list of Edges, but by being able to return both it requires users code to check what it actually got in return. If you simply returned a list of Edges then it is easy for the user to check for None or len() of 1
  • Dec 12, 2008
    issue 17 (Error while trying to run example pydot script on dkbza.org) commented on by chris0wj   -   Patch worked for me. Thanks.
    Patch worked for me. Thanks.
  • Oct 17, 2008
    issue 17 (Error while trying to run example pydot script on dkbza.org) commented on by shashank.ramaprasad   -   I am not sure how exactly to submit a patch, but this should fix the issue: $ svn diff pydot.py Index: pydot.py =================================================================== --- pydot.py (revision 9) +++ pydot.py (working copy) @@ -234,7 +234,7 @@ for edge in edge_list: - e = Edge( node_prefix + edge[0], node_prefix + edge[1] ) + e = Edge( node_prefix + str(edge[0]), node_prefix + str(edge[1]) ) graph.add_edge(e) return graph
    I am not sure how exactly to submit a patch, but this should fix the issue: $ svn diff pydot.py Index: pydot.py =================================================================== --- pydot.py (revision 9) +++ pydot.py (working copy) @@ -234,7 +234,7 @@ for edge in edge_list: - e = Edge( node_prefix + edge[0], node_prefix + edge[1] ) + e = Edge( node_prefix + str(edge[0]), node_prefix + str(edge[1]) ) graph.add_edge(e) return graph
  • Oct 17, 2008
    issue 17 (Error while trying to run example pydot script on dkbza.org) reported by shashank.ramaprasad   -   What steps will reproduce the problem? 1. Copy the example pydot Python script into a file: $ cat example.py import pydot edges=[(1,2), (1,3), (1,4), (3,4)] g=pydot.graph_from_edges(edges) g.write_jpeg('graph_from_edges_dot.jpg', prog='dot') 2. Run this script: $ python example.py Traceback (most recent call last): File "example.py", line 4, in ? g=pydot.graph_from_edges(edges) File "/d0/home/sramapra/personal/pydot-read-only/pydot.py", line 237, in graph_from_edges e = Edge( node_prefix + edge[0], node_prefix + edge[1] ) TypeError: cannot concatenate 'str' and 'int' objects What is the expected output? What do you see instead? I should get a jpeg file that contains the graph. I instead see the traceback mentioned above. What version of the product are you using? On what operating system? $ uname -a Linux arakkis 2.6.18.8-0.11-default #1 SMP Sat Oct 11 16:17:11 UTC 2008 x86_64 x86_64 x86_64 GNU/Linux From pydot help: VERSION 1.0.2 Comments: It appears that simply coercing the edge elements to strings will fix the issue: e = Edge( node_prefix + str( edge[0] ), node_prefix + str( edge[1] ) )
    What steps will reproduce the problem? 1. Copy the example pydot Python script into a file: $ cat example.py import pydot edges=[(1,2), (1,3), (1,4), (3,4)] g=pydot.graph_from_edges(edges) g.write_jpeg('graph_from_edges_dot.jpg', prog='dot') 2. Run this script: $ python example.py Traceback (most recent call last): File "example.py", line 4, in ? g=pydot.graph_from_edges(edges) File "/d0/home/sramapra/personal/pydot-read-only/pydot.py", line 237, in graph_from_edges e = Edge( node_prefix + edge[0], node_prefix + edge[1] ) TypeError: cannot concatenate 'str' and 'int' objects What is the expected output? What do you see instead? I should get a jpeg file that contains the graph. I instead see the traceback mentioned above. What version of the product are you using? On what operating system? $ uname -a Linux arakkis 2.6.18.8-0.11-default #1 SMP Sat Oct 11 16:17:11 UTC 2008 x86_64 x86_64 x86_64 GNU/Linux From pydot help: VERSION 1.0.2 Comments: It appears that simply coercing the edge elements to strings will fix the issue: e = Edge( node_prefix + str( edge[0] ), node_prefix + str( edge[1] ) )
  • Aug 27, 2008
    issue 16 (attributes missing from Dot) reported by james.baca   -   What steps will reproduce the problem? >>> import pydot >>> import pickle >>> test = pydot.Dot() >>> output = open("data.pkl", "wb") >>> pickle.dump(test, output) What is the expected output? What do you see instead? Expect no output and I get this: AttributeError: 'Dot' object has no attribute 'attributes' What version of the product are you using? On what operating system? version: '1.0.2' operating system: Linux Please provide any additional information below. I like turtles. I like this project too. Thanks
    What steps will reproduce the problem? >>> import pydot >>> import pickle >>> test = pydot.Dot() >>> output = open("data.pkl", "wb") >>> pickle.dump(test, output) What is the expected output? What do you see instead? Expect no output and I get this: AttributeError: 'Dot' object has no attribute 'attributes' What version of the product are you using? On what operating system? version: '1.0.2' operating system: Linux Please provide any additional information below. I like turtles. I like this project too. Thanks
  • Aug 08, 2008
    issue 12 (Example some wrong with version 1.0.2) commented on by hasbun.cristian   -   i run directly from console... and no problem IDLE do thats kind of stuff with many libraries
    i run directly from console... and no problem IDLE do thats kind of stuff with many libraries
  • Aug 08, 2008
    issue 12 (Example some wrong with version 1.0.2) commented on by hasbun.cristian   -   Same Here help please
    Same Here help please
  • Jul 31, 2008
    issue 15 ("strict" directive not properly handled (1.0.2)) reported by brolston   -   From the DOT user's guide at http://www.graphviz.org/Documentation/dotguide.pdf: "In the top-level graph heading, a graph may be declared a strict digraph. This forbids the creation of self-arcs and multi-edges; they are ignored in the input file." The pydot parser does not do this. It creates the self-arcs and multi-edges anyway, regardless of whether a graph is declared as "strict."
    From the DOT user's guide at http://www.graphviz.org/Documentation/dotguide.pdf: "In the top-level graph heading, a graph may be declared a strict digraph. This forbids the creation of self-arcs and multi-edges; they are ignored in the input file." The pydot parser does not do this. It creates the self-arcs and multi-edges anyway, regardless of whether a graph is declared as "strict."
 
Hosted by Google Code