Skip to content
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

Fix leaky ps #8264

Merged
merged 5 commits into from Mar 21, 2017
Merged

Fix leaky ps #8264

merged 5 commits into from Mar 21, 2017

Conversation

tacaswell
Copy link
Member

closes #8260

Targeted at 2.1 as this is touching code we don't touch very often to fix a very old bug that leaked temporary files.

Rather than closing over it and relying on it being defined in the
top-level function namespace.
In cases were a filename is passed in we clean up the temporary file
by renaming it to the output file, however if a file handle is passed
in we copy the contents into that the file and do not clean up the
temporary file.

Use a try...finally block to always remove the temporary file, even if
things go wrong.
In cases were a filename is passed in we clean up the temporary file
by renaming it to the output file, however if a file handle is passed
in we copy the contents into that the file and do not clean up the
temporary file.

Use a try...finally block to always remove the temporary file, even if
things go wrong.
@tacaswell tacaswell added this to the 2.1 (next point release) milestone Mar 10, 2017
Copy link
Contributor

@anntzer anntzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (clearly that piece of code could probably use some cleanup but that can wait...).

@anntzer anntzer changed the title Fix leaky ps [MRG+1] Fix leaky ps Mar 21, 2017
@NelleV NelleV merged commit d278160 into matplotlib:master Mar 21, 2017
@QuLogic QuLogic changed the title [MRG+1] Fix leaky ps Fix leaky ps Mar 21, 2017
@tacaswell tacaswell deleted the fix_leaky_ps branch March 22, 2017 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_backend_ps.py leaves temporary files in /tmp
4 participants