Skip to content
Browse files

Fixes #1879: Properly decode filenames that we get from fc-match

  • Loading branch information...
1 parent 2920408 commit 2415c6200ebdba75a0571d71a4569f18153fff57 @mdboom mdboom committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/matplotlib/
3 lib/matplotlib/
@@ -1289,11 +1289,12 @@ def fc_match(pattern, fontext):
if pipe.returncode == 0:
for match in _fc_match_regex.finditer(output):
file =
+ 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'):

4 comments on commit 2415c62


Was that b intentional?

Matplotlib Developers member

Yes -- but Python requires it to be br, not rb. Sorry about that.

Matplotlib Developers member

Ah - My bad for merging. Thanks for fixing @mdboom

Please sign in to comment.
Something went wrong with that request. Please try again.