-
-
Notifications
You must be signed in to change notification settings - Fork 8k
font_manager.py UnicodeDecodeError when starting ipython --pylab #2307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Seems this can be fixed by changing line 398 from
sfnt4 = sfnt4.decode('ascii').lower()
to
sfnt4 = sfnt4.decode('ascii', 'ignore').lower()
however I'm not sure if this results in any side effects.
@cycomanic: Can you confirm this patch resolves your issue?
This may also fix #2320.
Thanks -- it was helpful to know the problematic font. It contains a non-ascii character as its name -- according to this (http://www.freetype.org/freetype2/docs/reference/ft2-truetype_tables.html#TT_MAC_ID_XXX), that entry is supposed to be "macroman" and not "ascii", so I've updated matplotlib to reflect that.
I will try later tonight.
Cheers
Jochen
On 27/08/13 04:26, Michael Droettboom wrote:
@cycomanic: Can you confirm this patch resolves your issue?
This may also fix #2320.
Reply to this email directly or view it on GitHub:
#2307 (comment)
👍 Tried it, works! (See #2320 (comment))
font_manager.py UnicodeDecodeError when starting ipython --pylab
mjanikas
commented
Oct 21, 2013
I am having the same issue where my software package employs matplotlib1.3.0. We are almost about to release and I was hoping that you could confirm that in fact, the ONLY change needed to fix this issue is the movement of 'ascii' to 'macroman' in those two locations in font_manager.py.
BTW, we have a ton of harness tests across a myriad of languages and this solution had worked for us in regards to fixing the traceback. I am just being extra cautious. Thanks for the heads up ahead of time.
Cheers,
MJ
I'm experiencing a UnicodeDecodeError when starting ipython --pylab.
System: Debian Sid
$apt-cache policy python-matplotlib
python-matplotlib:
Installed: 1.3.0-1
This seems to be caused by on of the font name containing non-ascii characters. The font causing the issues seems to be " Systematic TT BRK" from the ttf-aenigma package in debian sid. Error message below:
/usr/lib/pymodules/python2.7/matplotlib/font_manager.py in ttfFontProperty(font)
396 sfnt2 = ''
397 if sfnt4:
--> 398 sfnt4 = sfnt4.decode('ascii').lower()
399 else:
400 sfnt4 = ''
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc6 in position 0: ordinal
not in range(128)