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

Skip to content

Commit ac20f76

Browse files
author
greg-roper
committed
Catch IO errors when building font cache
Problem seen on Windows machines where permission was denied when trying to load specific fonts (DINpro Light).
1 parent b1bab75 commit ac20f76

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)