Closed ankostis closed 2 years ago
Thanks, see graphviz changelog for context.
Thank you.
Is it still splitting the path-to-render into dirname & filename, and feeding the former to Popen()
, or not?
It is. This is needed to start the rendering process from the directory of the file. IIUC, the more general issue is that one cannot cd
into a UNC-path, correct? Maybe mounting the UNC as network drive is a possible workaround.
Feel free to open an issue at https://github.com/xflr6/graphviz/issues replacing this one (with the possibility that it might be closed as WAI in the end).
Maybe we can add an argument to keep the cwd
as is or special case UNCs in some way (maybe issueing a warning that relative file references don't work with them).
Hm, from a web search on python "UNC paths are not supported"
and the error message referring to CMD.EXE
I am not sure any more if this might in fact be an issue with the distribution package here (AFAIK, vanilla graphviz
(https://pypi.org/project/graphviz/) starts the rendering process with shell=False
), can you try with pip install graphviz
?
My apologies, don't have access to my Windows machine in the office (my personal one is a Linux), and due to covid19, it would be quite some time before i get to office, northern Italy :-)
No worries :) Long time since I have used SMB shares, maybe I can come up with something for testing..
@ankostis, have you had a chance to get access to a Windows machine since and test out @xflr6's suggestions?
Going to close this out.
Since this issue was opened, we started building graphviz
ourselves on Windows ( https://github.com/conda-forge/graphviz-feedstock/pull/59 ), which allowed us to drop the wrapper batch script mentioned above and some patching we were doing to the python-graphviz
package. This would make pretty significant changes on the Windows side of things compared to when the problem previously appeared.
Admittedly there could still be an issue here and there may be room for following up on some things upstream as discussed above. However it is unclear at the moment whether the same issue would still surface.
If the issue does persist on a fresh install, the next step would be to file a new issue (referencing this one) and sharing a simple reproducer (along with the other info requested in the issue template) so folks can debug further.
The latest
python-graphviz-0.13
& Anaconda'sgraphviz-2.38.0
on Windows fails when rendering UNC paths, with:This used to be ok with
python-graphviz-8.4
.The reason seems to be that in
v0.13
the rendered path gets split intodirname
&filename
, and the former is used ascwd
kwarg inPopen
, which chokes with UNC paths in it.I've tested intermediate releases 0.12 & 0.11.1 and they all had similar behavior (0.10 seemed not to work at all).
Related also to conda-forge/graphviz-feedstock#34 (comment) where it discusses the forthcomin natively built
graphviz-2.40
, without the dreaded BATs patch causing this problem.