From c766846f3bc54aa27cac83fa96bedc700e0466fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Zabalza?= Date: Wed, 3 Aug 2016 23:28:06 +0100 Subject: [PATCH] read cached afm files as bytes --- lib/matplotlib/mathtext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index 0cb6a481a413..187b2a3c525b 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -1119,7 +1119,7 @@ def _get_font(self, font): cached_font = self.fonts.get(basename) if cached_font is None: fname = os.path.join(self.basepath, basename + ".afm") - with open(fname, 'r') as fd: + with open(fname, 'rb') as fd: cached_font = AFM(fd) cached_font.fname = fname self.fonts[basename] = cached_font