Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 2415c6200ebdba75a0571d71a4569f18153fff57 1 parent 2920408
@mdboom mdboom authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/matplotlib/font_manager.py
View
3  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'):

4 comments on commit 2415c62

@pferreir

Was that b intentional?

@mdboom
Owner

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

@pelson
Collaborator

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

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