Skip to content

transmute: enforce render_dot file to str type#1088

Merged
jdknight merged 1 commit intomainfrom
force-render-dot-as-str-type
Feb 16, 2025
Merged

transmute: enforce render_dot file to str type#1088
jdknight merged 1 commit intomainfrom
force-render-dot-as-str-type

Conversation

@jdknight
Copy link
Member

Old render_dot returned a str but Sphinx v8.2 comes with a wrapper to prepare for the type changing to a Path type. Sphinx's usage of render_dot will generate a file type and use it in the translator, but this extension replaces the node here with a compatible nodes.image type ahead of time (e.g. for asset processing). The nodes.image type expects a str type, so convert ensure any new Path-like type is converted back to a str to prevent issues.

Old `render_dot` returned a `str` but Sphinx v8.2 comes with a wrapper
to prepare for the type changing to a `Path` type. Sphinx's usage of
`render_dot` will generate a file type and use it in the translator, but
this extension replaces the node here with a compatible `nodes.image`
type ahead of time (e.g. for asset processing). The `nodes.image` type
expects a `str` type, so convert ensure any new Path-like type is
converted back to a `str` to prevent issues.

Signed-off-by: James Knight <git@jdknight.me>
@jdknight jdknight merged commit 11f9ba7 into main Feb 16, 2025
29 checks passed
@jdknight jdknight deleted the force-render-dot-as-str-type branch February 16, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant