cudadog / pydot

Automatically exported from code.google.com/p/pydot
MIT License
0 stars 0 forks source link

Basic pydot usage error #77

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use Python 3.2.3 on fedora and pydot port to Python3
2. try following code:
import pydot
P = pydot.Dot()
D = P.create_dot().decode('utf-8')
print(D)
Q=pydot.graph_from_dot_data(D)

What is the expected output? What do you see instead?
Expected result is no error. I get the following error:
$python3.2 foo1.py
digraph G {
    node [label="\N"];
    graph [bb="0,0,0,0"];
}

Traceback (most recent call last):
  File "foo1.py", line 5, in <module>
    Q=pydot.graph_from_dot_data(D)
  File "/nh/nest/u/aric/.local/lib/python3.2/site-packages/pydot-1.0.15-py3.2.egg/pydot.py", line 211, in graph_from_dot_data
    return dot_parser.parse_dot_data(data)
  File "/nh/nest/u/aric/.local/lib/python3.2/site-packages/pydot-1.0.15-py3.2.egg/dot_parser.py", line 472, in parse_dot_data
    if data.startswith( codecs.BOM_UTF8 ):
TypeError: startswith first arg must be str or a tuple of str, not bytes

For more information, please see: 
https://github.com/networkx/networkx/issues/790

What version of the product are you using? On what operating system?
Fedora 17, x86_64
Pydot - newest version from Python3 branch: 
https://bitbucket.org/prologic/pydot/overview
Python 3.2.3
python3-pyparsing 1.5.6

Please provide any additional information below.

Original issue reported on code.google.com by wojtek.d...@gmail.com on 5 Nov 2012 at 8:31