Citing Debian bug #468989 [1]:
[..] The C API requires using the same memory API for a given memory block, which will show up as a segfault, at least in python2.5. This code was found by a search of all sources build-depending on python-dev, having a PyObject_ function for allocation and a PyMem_ function for deallocation in the same file. [..]
The attached patch is the proposed fix applied for Debian.
proposed patch
changes applied selectively. note that the proposed patch itself violates the API requirement by releasing blocks with PyObject_Del which were in fact allocated with PyMem_NEW...
Also note that sglite and ExtensionClass are being dropped from PyMOL and pyopengl is presently INOP and may be dropped as well.
all the affected modules are not used anymore and have been removed from the contrib folder