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 08cf3b1

Browse filesBrowse files
anntzerMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR #9676: FIX: Catch IOError on font-cache write
1 parent f1e75cb commit 08cf3b1
Copy full SHA for 08cf3b1

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed

‎lib/matplotlib/font_manager.py

Copy file name to clipboardExpand all lines: lib/matplotlib/font_manager.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,8 +965,10 @@ def json_dump(data, filename):
965965
Handles FontManager and its fields."""
966966

967967
with open(filename, 'w') as fh:
968-
json.dump(data, fh, cls=JSONEncoder, indent=2)
969-
968+
try:
969+
json.dump(data, fh, cls=JSONEncoder, indent=2)
970+
except IOError as e:
971+
warnings.warn('Could not save font_manager cache ', e)
970972

971973
def json_load(filename):
972974
"""Loads a data structure as JSON from the named file.

0 commit comments

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