small bug report ...

The SVG backend, as called from the GUI frame on (GTKAgg),

    > doesn't properly close it's file object after writing the
    > data.

    > I've been wondering why only half my svg-figures are saved
    > ... the write-cache wasn't being flushed until the python
    > process died.

It was my understanding that file handles close when they go out of
scope. Did you apply a patch that fixed your problem? Is it enough
to do

  svgwriter.close()

Is there any chance you are running this app from a threaded shell, eg
ipython in the -pylab mode or -gthread mode?

JDH

John Hunter wrote:

"Bryan" == Bryan Cole <bryan.cole@...199...> writes:

    > The SVG backend, as called from the GUI frame on (GTKAgg),
    > doesn't properly close it's file object after writing the
    > data.

    > I've been wondering why only half my svg-figures are saved
    > ... the write-cache wasn't being flushed until the python
    > process died.

It was my understanding that file handles close when they go out of
scope.

No, this is NOT guaranteed behavior of Python, is implementation dependent (I think Jython behaves differently), and I've seen stern warnings from some core developers against relying on it. Matplotlib should explicitly close ALL open filehandles, everywhere.

Is it enough
to do

  svgwriter.close()

Yes, but this should be applied across all file handling operations in the codebase. Otherwise, it's a timebomb waiting to go off (and it will).

Best,

f