sphinx-contrib / plantuml

BSD 2-Clause "Simplified" License
113 stars 40 forks source link

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

Open JensWalther opened 1 month ago

JensWalther commented 1 month 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 1 month 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