Strange Build problem....

Toshio Kuratomi a.badger at gmail.com
Wed Jan 16 17:27:54 UTC 2013


On Wed, Jan 16, 2013 at 11:59:08AM -0500, Steve Dickson wrote:
> 
> 
> 
> and here is the traceback
> 
> raceback (most recent call last):
>   File "/tmp/test.py", line 5, in <module>
>     import matplotlib.pyplot as plt
>   File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 26, in <module>
>     from matplotlib.figure import Figure, figaspect
>   File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 34, in <module>
>     import matplotlib.colorbar as cbar
>   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 37, in <module>
>     import matplotlib.widgets as widgets
>   File "/usr/lib64/python2.7/site-packages/matplotlib/widgets.py", line 17, in <module>
>     from lines import Line2D
>   File "/usr/lib64/python2.7/site-packages/matplotlib/lines.py", line 25, in <module>
>     from matplotlib.font_manager import FontProperties
>   File "/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py", line 1325, in <module>
>     _rebuild()
>   File "/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py", line 1312, in _rebuild
>     fontManager = FontManager()
>   File "/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py", line 994, in __init__
>     self.defaultFont['afm'] = self.afmfiles[0]
> IndexError: list index out of range
> 
> So it appears to be a problem with matplotlib.... 
> 
> My question is why is this happen *only* in a mock environment??? 
> Is it  because that environment does not have a needed package??? 
> 

That seems like a good guess to me.  Looking at the root.log for your build,
the only font package installed is dejavu-sans-fonts.  That font package
only includes true type fonts on rawhide and this matplotlib code is looking
for afm fonts.  One fix/workaround may be to include a BuildRequires/Requires
for a font that ships an afm font file.

Looking at the F17 version of matplotlib, the default afm font is being set
to None there -- so a better fix (but requiring fixing in matplotlib) might
be to patch it like this:


--- /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py       2012-12-04 21:32:42.000000000 -0500
+++ font_manager.py     2013-01-16 12:26:21.861202681 -0500
@@ -991,7 +991,10 @@
         self.afmfiles = findSystemFonts(paths, fontext='afm') + \
             findSystemFonts(fontext='afm')
         self.afmlist = createFontList(self.afmfiles, fontext='afm')
-        self.defaultFont['afm'] = self.afmfiles[0]
+        try:
+            self.defaultFont['afm'] = self.afmfiles[0]
+        except IndexError:
+            self.defaultFont['afm'] = None
 
         self.ttf_lookup_cache = {}
         self.afm_lookup_cache = {}

-Toshio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.fedoraproject.org/pipermail/devel/attachments/20130116/ccaa5705/attachment.sig>


More information about the devel mailing list