backend_pgf: open file handles on Windows #1324

Closed
pwuertz opened this Issue Oct 2, 2012 · 5 comments

Projects

None yet

3 participants

@pwuertz
Collaborator
pwuertz commented Oct 2, 2012

For determining font metrics, the pgf backend is communicating with a spawned LaTeX instance. A problem on Windows is that a process spawned by subprocess automatically inherits all open file descriptors and keeps them open as long as the subprocess is running. As a result, the application will hold on to the files and moving or deleting them may fail. There is an option called close_fds that prevents this from happening, but if you enable that option there is no way of communicating with the process.

I don't see how this can be done with stdin/stdout on Windows, so the only solution appears to be the development of a own simple inter-process communication and not to inherit fds when spawning the subprocess.

@pwuertz pwuertz pushed a commit to pwuertz/matplotlib that referenced this issue Oct 2, 2012
pwuertz backend_pgf: add a remark concerning #1324 to the doc, some cleanup ff5cd1c
@pwuertz pwuertz was assigned Oct 2, 2012
@pelson
Member
pelson commented May 22, 2013

@pwuertz - how does this issue stand? Has this been addressed, or indeed, has anybody come across this issue?

@pwuertz
Collaborator
pwuertz commented May 22, 2013

No, this problem is very specific and most of the time you wouldn't notice it at all. The latest fix I added back then at least reduces the problem to long running applications that won't be able to delete the temporary directories created for compiling figures.
It is a known limitation on windows (I've raged around in #1286 about that) for which you'll find a few discussions on stackoverflow - but no solution so far.

@mdboom
Member
mdboom commented May 22, 2013

I was just going to ask that you add a note to the docs, but I see it's already there...

While I understand a "real" solution hasn't been found, if we feel the research has been exhausted, maybe we close this just to keep the number of open bugs down?

@pwuertz
Collaborator
pwuertz commented May 22, 2013

Ok, closing this issue as 'wontfix'.

@pwuertz pwuertz closed this May 22, 2013
@pwuertz
Collaborator
pwuertz commented Sep 10, 2013

Good news! It seems that the inherited file descriptor bug is going to be solved in the upcoming python version 3.4.
http://www.python.org/dev/peps/pep-0446/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment