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

Skip to content

Commit b34c55d

Browse files
authored
Merge pull request #7222 from greg-roper/master
Catch IO errors when building font cache
2 parents dc12ca4 + ac20f76 commit b34c55d

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
@@ -591,6 +591,9 @@ def createFontList(fontfiles, fontext='ttf'):
591591
verbose.report("Cannot handle unicode filenames")
592592
# print >> sys.stderr, 'Bad file is', fpath
593593
continue
594+
except IOError:
595+
verbose.report("IO error - cannot open font file %s" % fpath)
596+
continue
594597
try:
595598
prop = ttfFontProperty(font)
596599
except (KeyError, RuntimeError, ValueError):

0 commit comments

Comments
 (0)