This bug happens when drawing a figure when using AFM fonts (ps.useafm=True) and setting ScalarFormatter(useMathText=True), The _sanity_check() function in aft.py requires a BufferedReader, while the "_get_font()" function in mathext.py returns TextIOWrapper if cached_font is None: fname = os.path.join(self.basepath, basename + ".afm") with open(fname, 'r') as fd: print(fd) cached_font = AFM(fd) cached_font.fname = fname self.fonts[basename] = cached_font self.fonts[cached_font.get_fontname()] = cached_font return cached_font The line "with open(fname, 'r') as fd:" should be "with open(fname, 'rb') as fd:"
Activity
tacaswell commentedon Sep 14, 2016
Can you try with the 2.0.0b4 release?
This should be fixed by #6898
tacaswell commentedon Sep 14, 2016
@lijunsun Thank you for taking the time to report this issue and suggest a solution!