Skip to content
This repository

Include username in tempdir #1213

Merged
merged 1 commit into from over 1 year ago

2 participants

Michael Droettboom Phil Elson
Michael Droettboom
Owner

Fixes an issue introduced by #832. If multiple users on the same machine have non-writable home directories, the /tmp/matplotlib directory created may be shared. This includes the user's login name in the directory name to prevent that.

Discovered by Matt Anderson.

Michael Droettboom Put user's name in the temp directory that gets created when the home…
… directory is not writable. Fixes race conditions on a multi-user machine discovered by Matt Anderson.
0ee2e5d
Phil Elson
Collaborator

I see no harm in this change. +1

Michael Droettboom mdboom merged commit d563d62 into from September 07, 2012
Michael Droettboom mdboom closed this September 07, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 07, 2012
Michael Droettboom Put user's name in the temp directory that gets created when the home…
… directory is not writable. Fixes race conditions on a multi-user machine discovered by Matt Anderson.
0ee2e5d
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 3 additions and 1 deletion. Show diff stats Hide diff stats

  1. 4  lib/matplotlib/__init__.py
4  lib/matplotlib/__init__.py
@@ -471,9 +471,11 @@ def _create_tmp_config_dir():
471 471
     If the config directory can not be created, create a temporary
472 472
     directory.
473 473
     """
  474
+    import getpass
474 475
     import tempfile
475 476
 
476  
-    tempdir = os.path.join(tempfile.gettempdir(), 'matplotlib')
  477
+    tempdir = os.path.join(
  478
+        tempfile.gettempdir(), 'matplotlib-%s' % getpass.getuser())
477 479
     os.environ['MPLCONFIGDIR'] = tempdir
478 480
 
479 481
     return tempdir
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.