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 7042ab5

Browse filesBrowse files
authored
Merge pull request #12410 from meeseeksmachine/auto-backport-of-pr-12408-on-v3.0.x
Backport PR #12408 on branch v3.0.x (Don't crash on invalid registry font entries on Windows.)
2 parents 2765efb + 4646864 commit 7042ab5
Copy full SHA for 7042ab5

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+6
-1
lines changed

‎lib/matplotlib/font_manager.py

Copy file name to clipboardExpand all lines: lib/matplotlib/font_manager.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,12 @@ def win32InstalledFonts(directory=None, fontext='ttf'):
199199
# Work around for https://bugs.python.org/issue25778, which
200200
# is fixed in Py>=3.6.1.
201201
direc = direc.split("\0", 1)[0]
202-
path = Path(directory, direc).resolve()
202+
try:
203+
path = Path(directory, direc).resolve()
204+
except (FileNotFoundError, RuntimeError):
205+
# Don't fail with invalid entries (FileNotFoundError is
206+
# only necessary on Py3.5).
207+
continue
203208
if path.suffix.lower() in fontext:
204209
items.add(str(path))
205210
except (OSError, MemoryError):

0 commit comments

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