-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
backend_pgf: improve handling of temporary directories #1286
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
@cgohlke Does this fix the problem on Windows? |
Hmpf, sometimes pyhton can be a real pain. There is no way of designing a reliable destructor. Using atexit now for cleaning up the remaining temporary directories. I also removed the use of chdir when working with temp dirs, I think @cgohlke had some concern regarding multithreading. |
I'm officially going insane. This new handling of temporary directories should be perfectly fine, but the situation on Windows just got a lot worse on my VM test system. I found an application called "ProcessExplorer" that can find and show the open file handles for each running process. The problem on windows is that a spawned child process automatically inherits all open file descriptors and keeps them open as long as the subprocess is running. There is an option called This is a really bad limitation, almost looks like a "won't fix". I don't even dare to imagine what this limitation means for multithreading support on Windows. |
Ok, this is the best I can do for now :). Unfortunately on Windows the only real solution is not to inherit fds when spawning a subprocess and then to develop another way of inter-process communication. I don't see how this can be done with stdin/stdout on Windows... |
@pwuertz Are you happy with this pull request? I'm not a Windows guy, but this is milestoned for 1.2.x. Should it be merged? |
@dmcdougall I'm not really happy, but I don't see another solution right now. I'm not a Windows guy either, pretty demoralized by the limitations I encountered and hoped for some feedback that magically solves the problem. Let me just add some warning in the documentation and then this PR is good to go. |
Ok, forwarding the discussion / solution to #1324. This PR should be good for 1.2 now. |
backend_pgf: improve handling of temporary directories
Addresses #1281 where deleting temporary directories fails on Windows. Also, for multithread safety, stop using os.chdir.