[77] Basic pydot usage error #14
Description
Reported by wojtek.d...@gmail.com, 2012-11-05T21:31:34Z
What steps will reproduce the problem?
- Use Python 3.2.3 on fedora and pydot port to Python3
- 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
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: networkx/networkx#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