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 c459cf4

Browse filesBrowse files
KojoleyMeeseeksDev[bot]
authored andcommitted
Backport PR #9504: Truncate windows registry entries after null byte.
1 parent 39daead commit c459cf4
Copy full SHA for c459cf4

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
@@ -226,15 +226,17 @@ def win32InstalledFonts(directory=None, fontext='ttf'):
226226
local = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, fontdir)
227227
except OSError:
228228
continue
229-
230229
if not local:
231230
return list_fonts(directory, fontext)
232231
try:
233232
for j in range(winreg.QueryInfoKey(local)[1]):
234233
try:
235-
key, direc, any = winreg.EnumValue( local, j)
234+
key, direc, tp = winreg.EnumValue(local, j)
236235
if not isinstance(direc, six.string_types):
237236
continue
237+
# Work around for https://bugs.python.org/issue25778, which
238+
# is fixed in Py>=3.6.1.
239+
direc = direc.split("\0", 1)[0]
238240
if not os.path.dirname(direc):
239241
direc = os.path.join(directory, direc)
240242
direc = os.path.abspath(direc).lower()

0 commit comments

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