From: Peter Krempa <pkre...@redhat.com> Trying to run 'render_block_graph' produces following warnings on machine with python 3.12:
$ ./scripts/render_block_graph.py cd-throttle ble.png ./scripts/render_block_graph.py:57: SyntaxWarning: invalid escape sequence '\l' ' w - Write\l' ./scripts/render_block_graph.py:58: SyntaxWarning: invalid escape sequence '\l' ' r - consistent-Read\l' ./scripts/render_block_graph.py:59: SyntaxWarning: invalid escape sequence '\l' ' u - write - Unchanged\l' ./scripts/render_block_graph.py:60: SyntaxWarning: invalid escape sequence '\l' [...] The graphviz '\l' escape sequence is used to left-justify the line and new python started enforcing of strings to contain only known escape sequences. Convert the strings containing the dot language to raw. Signed-off-by: Peter Krempa <pkre...@redhat.com> --- scripts/render_block_graph.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/render_block_graph.py b/scripts/render_block_graph.py index 3e1a2e3fa7..14b2d02ec2 100755 --- a/scripts/render_block_graph.py +++ b/scripts/render_block_graph.py @@ -53,16 +53,16 @@ def render_block_graph(qmp, filename, format='png'): graph = Digraph(comment='Block Nodes Graph') graph.format = format - graph.node('permission symbols:\l' - ' w - Write\l' - ' r - consistent-Read\l' - ' u - write - Unchanged\l' - ' g - Graph-mod\l' - ' s - reSize\l' - 'edge label scheme:\l' - ' <child type>\l' - ' <perm>\l' - ' <shared_perm>\l', shape='none') + graph.node(r'permission symbols:\l' + r' w - Write\l' + r' r - consistent-Read\l' + r' u - write - Unchanged\l' + r' g - Graph-mod\l' + r' s - reSize\l' + r'edge label scheme:\l' + r' <child type>\l' + r' <perm>\l' + r' <shared_perm>\l', shape='none') for n in block_graph['nodes']: if n['type'] == 'block-driver': @@ -83,8 +83,8 @@ def render_block_graph(qmp, filename, format='png'): graph.node(str(n['id']), label, shape=shape) for e in block_graph['edges']: - label = '%s\l%s\l%s\l' % (e['name'], perm(e['perm']), - perm(e['shared-perm'])) + label = r'%s\l%s\l%s\l' % (e['name'], perm(e['perm']), + perm(e['shared-perm'])) graph.edge(str(e['parent']), str(e['child']), label=label) graph.render(filename) -- 2.48.1