=== modified file 'pygtk/gtkcrashhandler.py'
--- pygtk/gtkcrashhandler.py	2010-03-02 21:16:36 +0000
+++ pygtk/gtkcrashhandler.py	2010-08-24 20:25:00 +0000
@@ -47,7 +47,7 @@
     import pango
     import gobject
     _gtk_initialized = True
-except Exception:
+except ImportError, AssertionError:
     print >> sys.stderr, "gtkcrashhandler could not load GTK 2.0"
     _gtk_initialized = False
 import traceback
@@ -55,12 +55,10 @@
 import threading
 
 APP_NAME = None
-MESSAGE = _("We're terribly sorry. Could you help us fix the problem by " \
-		  "reporting the crash?")
+MESSAGE = None
 USE_APPORT = False
 
-_old_sys_excepthook = None # None means that initialize() has not been called
-						   # yet.
+_old_sys_excepthook = None # None means that initialize() has not been called yet.
 
 def initialize(app_name=None, message=None, use_apport=False):
     """Initialize the except hook built on GTK.
@@ -79,12 +77,9 @@
 
     """
     global APP_NAME, MESSAGE, USE_APPORT, _gtk_initialized, _old_sys_excepthook
-    if app_name:
-    	APP_NAME = _(app_name)
-    if not message is None:
-    	MESSAGE = _(message)
-    if use_apport:
-    	USE_APPORT = use_apport
+    APP_NAME = app_name
+    MESSAGE = message
+    USE_APPORT = use_apport
     if _gtk_initialized == True and _old_sys_excepthook is None:
         # save sys.excepthook first, as it may not be sys.__excepthook__
         # (for example, it might be Apport's python hook)
@@ -106,16 +101,18 @@
     add_apport_button = False
     global USE_APPORT
     if USE_APPORT:
-    	# see if this file is from a properly installed distribution package
+        # see if this file is from a properly installed distribution package
         try:
             from apport.fileutils import likely_packaged
+            # this bit borrowed from apport_python_hook.py
+            # apport will look up the package from the executable path.
             try:
                 filename = os.path.realpath(os.path.join(os.getcwdu(),
-                	sys.argv[0]))
-            except:
-                filename = os.path.realpath("/proc/%i/exe" % os.getpid())
-            if not os.path.isfile(filename) or not os.access(filename, os.X_OK):
-                raise Exception()
+                       sys.argv[0]))
+            except (TypeError, AttributeError, IndexError):
+                filename = os.readlink('/proc/%i/exe' % os.getpid())
+            if not os.access(filename, os.X_OK) or not os.path.isfile(filename):
+                raise
             add_apport_button = likely_packaged(filename)
         except:
             add_apport_button = False
@@ -125,6 +122,7 @@
     if res == 3: # report button clicked
         # enable apport, overriding preferences
         try:
+            # This method works for old versions of Apport
             # create new temporary configuration file, where enabled=1
             import re
             from apport.packaging_impl import impl as apport_packaging
@@ -143,6 +141,13 @@
 
             # set apport to use this configuration file, temporarily
             apport_packaging.configuration = tempfilename
+            
+            # This method works for newer versions of Apport, tested with
+            # Apport version 1.13.3
+            import apport_python_hook
+            apport_python_hook.enabled = lambda: True
+            
+            
             # override Apport's ignore settings for this app
             from apport.report import Report
             Report.check_ignored = lambda self: False
@@ -169,7 +174,7 @@
     title = _("An error has occurred")
     global APP_NAME
     if APP_NAME:
-        title = APP_NAME
+        title = _(APP_NAME)
     dialog = gtk.Dialog(title)
 
     # title Label
@@ -180,9 +185,13 @@
 
     # message Label
     global MESSAGE
-    text_label = gtk.Label(MESSAGE)
+    if MESSAGE:
+        text_label = gtk.Label(MESSAGE)
+    else:
+        text_label = gtk.Label(_("Unfortunately, we haven't yet found and "
+                            "corrected this problem. You might want to "
+                            "report the crash to the developers."))
     text_label.set_alignment(0, 0.5)
-    
     text_label.set_line_wrap(True)
     def text_label_size_allocate(widget, rect):
         """Lets label resize correctly while wrapping text."""

