Skip to content

Dot and svg diagrams fail to generate without useful error message #649

Closed

Description

@barnettwilliam

When trying to generate dot or svg diagrams either exporting to a file or via Sphinx the diagram generation fails with no meaningful error just that the dot process exited code 1.

Retrieving the diagrams generated dot text string, creating a file, and using dot command directly more meaningful errors are given e.g.
Error: HandleCommandStateMachine_original.dot: syntax error in line 25 near ','

the corresponding lines in the dot file, excerpt from line 23-27:

    subgraph cluster_handle { 
        label=<<b>Handle</b><br/><font point-size=”9”>entry / on_enter_handle</font>>; 
        style=”rounded, solid”;    // ****** LINE 25
        cluster=true; 
        penwidth=2.0;

Unicode right double quotation marks U201D ” are used throughout, replacing these with straight quotation marks U0022 " dot completes successfully and correctly generates the svg file.

Strangely the errors only seem to only be raised at subgraph styles that have multiple properties like the one shown in this example.

OS: Debian 12 (bookworm)
dot: 2.43.0
python-statemachine: 3.2.1
pydot: 4.0.1
sphinx: 9.0.4
pyhton: 3.11.2

Thank you for this excellent library, the ability to generate diagrams and visualise state machines is particularly nice!

Activity

  1. added this to the 3.2.2 milestone on Oct 12, 2026
  2. fgmacedo commented on Oct 12, 2026

    @fgmacedo
    Owner

    Thanks for the detailed report, and for the kind words!

    I could not reproduce the curly quotes: with pydot 4.0.1 the renderer emits straight quotes (style="rounded, solid"), and grep for U+201C/U+201D over the library finds none in the generated DOT. The only place they could come from is the copy step between the library output and the .dot file, so if you still see them, could you share a minimal machine that produces them, how you exported the DOT text, and your Graphviz version (dot -V)?

    The part that is a real defect is the error message: pydot prints Graphviz's stderr to stdout and raises an AssertionError that only says returned code: 1, so the syntax error in line 25 near ',' never reaches the exception or the Sphinx warning. #672 fixes that: every path that runs dot (the svg format, _repr_svg_(), the command line and the Sphinx directive) now raises GraphvizError with the requested format and what Graphviz wrote to stderr, and the Sphinx build warning carries the same text. It will ship in 3.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions