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

Skip to content

Commit de6c955

Browse files
committed
Convert path to str in FontManager.addpath
1 parent f33f5ab commit de6c955

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/font_manager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,8 @@ def addfont(self, path):
10911091
----------
10921092
path : str or path-like
10931093
"""
1094+
path = str(path) # Convert to string in case of a path as
1095+
# afmFontProperty and FT2Font expect this
10941096
if Path(path).suffix.lower() == ".afm":
10951097
with open(path, "rb") as fh:
10961098
font = _afm.AFM(fh)

0 commit comments

Comments
 (0)