sphinx-contrib / plantuml

BSD 2-Clause "Simplified" License
117 stars 44 forks source link

Esbonio build fails with WinError 2: File in use error when renaming temporary file #94

Open JensWalther opened 6 months ago

JensWalther commented 6 months ago

https://github.com/sphinx-contrib/plantuml/blame/09f9d13c44bdbfb73974159cedd29bb1d2e08f69/sphinxcontrib/plantuml.py#L411

This close statement is "double" closing the temporary file causing the rename to fail occasionally. Observed with v.29 wheel file.

v.26 does not show this error.

JensWalther commented 6 months ago

The rename must happen behind the 'with' block as the explicit close inside the with block is incorrect and can cause undefined behavior such as the file not being closed. This causes the rename to fail

xfornari commented 2 months ago

I observe the same (v.30) and had to go back to v.26 as JensWalther mentionned (running on Windows)