-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix Inkscape cleanup at exit on Windows. #19811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Confirmed! It works for me (at least locally). Could you explain a bit how you came up with this specific solution? I understand that the process was keeping the tmpdir alive but still unsure of why the |
I'm not actually 100% sure of what's happening (especially wrt. the precise timing where |
This SO answer is helpful. Specifically, when using atexit, "what happens if a class is garbage collected before exit"? It seems that we should be able to perform cleanup solely with But then again there's definitely a use for atexit as indicated by the comment:
Using both seems unnecessary/redundant/prone to error as they are calling the same Of note too is this section from the docs:
So it seems that the function that finalize calls shouldn't be |
To be clear I'm not claiming my solution is best, just that it works empirically... but if you have something better, please open a PR :-) |
Yeah, absolutely, this seems to work and should be merged. I don't have a better solution, I was just curious as to if one exists/ how the atexit and finalize interplay. To be fair, the "best" solution would be to use these classes as context managers with |
…811-on-v3.4.x Backport PR #19811 on branch v3.4.x (Fix Inkscape cleanup at exit on Windows.)
PR Summary
Closes #19809, at least locally (@jungerm2 can you confirm it works for you?)
I'd rather not figure out how to mess with CI to get Inkscape on Windows as well...
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).