Hello, I am getting a UnicodeDecodeError after try import pylab and pyplot, from matplotlib, in python2. My keyboard is pt-br but I do not type any special character during the import. The console output follow below: $ python Python 2.7.5 (default, Aug 12 2013, 12:36:20) [GCC 4.8.2 20130808 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib >>> import matplotlib.pyplot Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 24, in <module> import matplotlib.colorbar File "/usr/lib64/python2.7/site-packages/matplotlib/colorbar.py", line 29, in <module> import matplotlib.collections as collections File "/usr/lib64/python2.7/site-packages/matplotlib/collections.py", line 23, in <module> import matplotlib.backend_bases as backend_bases File "/usr/lib64/python2.7/site-packages/matplotlib/backend_bases.py", line 50, in <module> import matplotlib.textpath as textpath File "/usr/lib64/python2.7/site-packages/matplotlib/textpath.py", line 11, in <module> import matplotlib.font_manager as font_manager File "/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py", line 1356, in <module> _rebuild() File "/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py", line 1341, in _rebuild fontManager = FontManager() File "/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py", line 1004, in __init__ self.ttflist = createFontList(self.ttffiles) File "/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py", line 584, in createFontList prop = ttfFontProperty(font) File "/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py", line 398, in ttfFontProperty sfnt4 = sfnt4.decode('ascii').lower() UnicodeDecodeError: 'ascii' codec can't decode byte 0x8a in position 5: ordinal not in range(128) >>> import matplotlib.pylab Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python2.7/site-packages/matplotlib/pylab.py", line 226, in <module> import matplotlib.finance File "/usr/lib64/python2.7/site-packages/matplotlib/finance.py", line 23, in <module> from matplotlib.collections import LineCollection, PolyCollection File "/usr/lib64/python2.7/site-packages/matplotlib/collections.py", line 23, in <module> import matplotlib.backend_bases as backend_bases File "/usr/lib64/python2.7/site-packages/matplotlib/backend_bases.py", line 50, in <module> import matplotlib.textpath as textpath File "/usr/lib64/python2.7/site-packages/matplotlib/textpath.py", line 11, in <module> import matplotlib.font_manager as font_manager File "/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py", line 1356, in <module> _rebuild() File "/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py", line 1341, in _rebuild fontManager = FontManager() File "/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py", line 1004, in __init__ self.ttflist = createFontList(self.ttffiles) File "/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py", line 584, in createFontList prop = ttfFontProperty(font) File "/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py", line 398, in ttfFontProperty sfnt4 = sfnt4.decode('ascii').lower() UnicodeDecodeError: 'ascii' codec can't decode byte 0x8a in position 5: ordinal not in range(128) >>> Thanks. Reproducible: Steps to Reproduce:
Hi, patch https://github.com/matplotlib/matplotlib/pull/2307?source=cc#issuecomment-22809088 can fix the problem.
Created attachment 4303 [details] Proposed patch A patch for fix this bug.
Keywords: (none) => PATCH, TriagedAssignee: bugsquad => makowski.mageia
python-matplotlib-1.3.0-2.mga4 should fix this
is the fix ok ?
Yes, it is ok! Thank you! I am having a problem with matplotlib now but it is related with upstream, not with Mageia. http://matplotlib.1069221.n5.nabble.com/Error-in-import-matplotlib-pyplot-using-Python-C-API-td41951.html I will close this bug report.
Status: NEW => RESOLVEDResolution: (none) => FIXED