Repository navigation
Fix svg writer for StringIO objects - #1380
Conversation
|
Also, |
|
This seems to have created a new Travis failure about seeking on a closed file. Needs further investigation. |
|
Regardless of the closing, I can confirm that the initial fix does the trick. Thanks. |
|
I assumed one would not seek the file once the figure has been written. Maybe I shouldn't assume this. Investigating... |
|
I see the problem. The test re-reads the saved figure to test that it's a valid svg file. There are two options:
I think I should probably undo the close change and assume the user doesn't want specially constructed file descriptors closed. Thoughts? |
|
Ok, I'm making a decision. This PR should fix the original problem and not try to fiddle with other things. I will undo the close change and keep the original solution. |
|
I think that's right, having just looked at this again. I think the intent is that only things that are created within that function should be closed. |
|
@mdboom Yeah. I think I'd be annoyed if functions started freeing memory when I didn't expect it. The tests pass now, too. |
|
Great! Merging. |
Fix svg writer for StringIO objects
Fix #1373.
This seems like a really simple fix. I'm a little concerned that it may now be possible to pass something to
print_svgthat doesn't make sense. Hopefully someone will correct me if this is the case.Also, I kind of feel like the write should be in a
try/finallyblock, likeprint_pngin theaggbackend.