Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c041352

Browse filesBrowse files
committed
Fix issues with getting tempdir when unknown uid
Closes #5940
1 parent bbe421a commit c041352
Copy full SHA for c041352

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed

‎lib/matplotlib/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/__init__.py
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,13 @@ def _create_tmp_config_dir():
553553
# Some restricted platforms (such as Google App Engine) do not provide
554554
# gettempdir.
555555
return None
556-
tempdir = os.path.join(tempdir, 'matplotlib-%s' % getpass.getuser())
556+
557+
try:
558+
username = getpass.getuser()
559+
except KeyError:
560+
username = str(os.getuid())
561+
tempdir = os.path.join(tempdir, 'matplotlib-%s' % username)
562+
557563
os.environ['MPLCONFIGDIR'] = tempdir
558564

559565
mkdirs(tempdir)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.