You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importsysimportpygraphvizG=pygraphviz.AGraph(strict=False, directed=True, name="TEST", fontsize=11.0)
label='Test Test test test test test testtest test\l"test test test test test test test test'n=G.add_node("TESTTEST", label=label, tooltip="", shape="rectangle", style="solid")
G.layout(prog='dot')
G.draw(sys.stdout.buffer, format='svg')
Produces the following error:
Traceback (most recent call last):
File "/t.py", line 10, in <module>
G.layout(prog='dot')
File "/usr/local/lib/python3.11/site-packages/pygraphviz/agraph.py", line 1483, in layout
data = self._run_prog(prog, " ".join([args, "-T", output_fmt]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pygraphviz/agraph.py", line 1404, in _run_prog
raise OSError(b"".join(errors).decode(self.encoding))
OSError: Error: <stdin>: syntax error in line 4 near 'test'
Debugging shows that the issue is apparently caused by unescaped quote during the layout process:
digraph TEST {
graph [fontsize=11.0];
node [label="\N"];
TESTTEST [label="Test Test test test test test testtest test\l"test test test test test test test test",
shape=rectangle,
style=solid];
}
Reproduced on macOS and Arch Linux.
The text was updated successfully, but these errors were encountered:
Running the following code sample with:
Produces the following error:
Debugging shows that the issue is apparently caused by unescaped quote during the layout process:
Reproduced on macOS and Arch Linux.
The text was updated successfully, but these errors were encountered: