8000 Clean tmpdir at exit. by anntzer · Pull Request #9869 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Clean tmpdir at exit. #9869

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

Merged
merged 1 commit into from
Nov 28, 2017
Merged

Clean tmpdir at exit. #9869

merged 1 commit into from
Nov 28, 2017

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Nov 27, 2017

Closes #9868.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Copy link
Member
@WeatherGod WeatherGod left a comment

Choose a reason for hiding this comment

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

Looks good to me. Perhaps a note should be added that the cleanup will only occur on normal program exits. So it won't always be cleaned up (which I consider to be a feature, since we could then inspect the tempdir if needed).

@anntzer
Copy link
Contributor Author
anntzer commented Nov 27, 2017

It's not as if we can do anything if someone sends a SIGTERM to the process anyways...

@@ -605,6 +607,7 @@ def _create_tmp_config_dir():
"""
configdir = os.environ['MPLCONFIGDIR'] = (
tempfile.mkdtemp(prefix='matplotlib-'))
atexit.register(shutil.rmtree, configdir)
Copy link
Member

Choose a reason for hiding this comment

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

Won't this rm the config directory even if it isn't a temporary directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's in "_create_tmp_config_dir"...

Copy link
Member

Choose a reason for hiding this comment

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

🤦‍♂️

@dstansby dstansby added this to the v2.2 milestone Nov 28, 2017
@dstansby dstansby merged commit 045c951 into matplotlib:master Nov 28, 2017
@anntzer anntzer deleted the clean-tmpdir branch November 28, 2017 15:31
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite number of /tmp/matplotlib-* dirs on machine without HOME env variable
4 participants
0