diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py index aa6fa1665b08..b5da12d8a6d7 100644 --- a/lib/matplotlib/font_manager.py +++ b/lib/matplotlib/font_manager.py @@ -1289,11 +1289,12 @@ def fc_match(pattern, fontext): if pipe.returncode == 0: for match in _fc_match_regex.finditer(output): file = match.group(1) + file = file.decode(sys.getfilesystemencoding()) if os.path.splitext(file)[1][1:] in fontexts: return file return None - _fc_match_regex = re.compile(r'\sfile:\s+"([^"]*)"') + _fc_match_regex = re.compile(rb'\sfile:\s+"([^"]*)"') _fc_match_cache = {} def findfont(prop, fontext='ttf'):