Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 9d39c92d573fcb9ae1f0c339f34d139b > files > 1

whaawmp-0.2.12.1-6.fc15.src.rpm

diff -up whaawmp-0.2.12.1/src/gui/__init__.py.fix-py27-CObject-capsule-crash whaawmp-0.2.12.1/src/gui/__init__.py
--- whaawmp-0.2.12.1/src/gui/__init__.py.fix-py27-CObject-capsule-crash	2010-12-30 13:18:14.816646617 -0500
+++ whaawmp-0.2.12.1/src/gui/__init__.py	2010-12-30 13:18:31.559647012 -0500
@@ -27,6 +27,21 @@
 import sys, warnings
 
 warnings.filterwarnings('error', module='gtk')
+
+# The above line requests that warnings from GTK should be turned into
+# exceptions.
+# Python 2.7 deprecated the PyCObject API, but GTK uses it, leading to a
+# PendingDeprecationWarning.  With the above line, this is raised as an
+# exception.
+# Unfortunately, GTK's C code assume that an exception can't be the result of
+# the PyCObject call, and uses the NULL pointer it gets back in various invalid
+# ways, leading to a hard failure of the python process:
+#   See https://bugzilla.redhat.com/show_bug.cgi?id=652368 (whaawmp)
+#   and https://bugzilla.redhat.com/show_bug.cgi?id=621887 (pygtk)
+# The following line says that that warning can be ignored, rather than
+# triggering the exception:
+warnings.simplefilter('ignore', PendingDeprecationWarning)
+
 try:
 	import gtk
 except ImportError: