Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b2314f

Browse files
NelleVQuLogic
authored andcommitted
Merge pull request #7222 from greg-roper/master
Catch IO errors when building font cache
1 parent 1f20eda commit 9b2314f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/font_manager.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,9 @@ def createFontList(fontfiles, fontext='ttf'):
594594
verbose.report("Cannot handle unicode filenames")
595595
# print >> sys.stderr, 'Bad file is', fpath
596596
continue
597+
except IOError:
598+
verbose.report("IO error - cannot open font file %s" % fpath)
599+
continue
597600
try:
598601
prop = ttfFontProperty(font)
599602
except (KeyError, RuntimeError, ValueError):

0 commit comments

Comments
 (0)