Comment 1 for bug 721158

Revision history for this message
Michka Popoff (michkapopoff) wrote :

I was able to make a minimalist test case for this bug :

import numpy
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from matplotlib.pylab import pcolor
pcolor(numpy.array([[1, 1],[1, 1]]))

The segfault disappears if I put the 3 OpenGL imports after the matplotlib import !
BUT :

- If I add : from gtk.gtkgl.apputils import * at the top (before the other imports), the segfault reappears.
- If I add this line after the imports, I get a new type of error :

Traceback (most recent call last):
  File "test.py", line 12, in <module>
    pcolor(numpy.array([[1, 1],[1, 1]]))
  File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 2077, in pcolor
    ax = gca()
  File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 582, in gca
    ax = gcf().gca(**kwargs)
  File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 276, in gcf
    return figure()
  File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 254, in figure
    **kwargs)
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", line 91, in new_figure_manager
    canvas = FigureCanvasTkAgg(figure, master=window)
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", line 159, in __init__
    self._tkcanvas.create_image(w/2, h/2, image=self._tkphoto)
  File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 2159, in create_image
    return self._create('image', args, kw)
  File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 2150, in _create
    *(args + self._options(cnf, kw))))
_tkinter.TclError: bad screen distance "320.0"

I didn't know that the import order was important. But I think there is something really messed up in the imports.
FYI I did test the code on another PC, same thing.

Do we have the same Python Version ? I have the 2.6.6-2ubuntu2 version.