I tried to run mkdocs serve on Windows 11 with a project with mkdocs-matplotlib and got the below error:
File "C:\Users\user\AppData\Local\Programs\Python\Python313\Lib\site-packages\mkdocs_matplotlib\plugin.py", line 48, in _rendered_image_to_dir
exec(savefig_code, global_namespace, local_namespace)
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 2
plt.savefig("C:\Users\user\AppData\Local\Temp\tmpeahgv9ei.svg", bbox_inches='tight')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
I'm guessing the issue is the use of \ to generate file paths, does that seem right? If so using pathlib or os.path.join to generate paths may resolve it.
I tried to run
mkdocs serveon Windows 11 with a project withmkdocs-matplotliband got the below error:I'm guessing the issue is the use of
\to generate file paths, does that seem right? If so usingpathliboros.path.jointo generate paths may resolve it.