Fixed Exception dialog crash when original exception contains unicode
authorEdouard Tisserant
Mon, 31 Mar 2014 00:27:05 +0200
changeset 1404 d4a6c9287e97
parent 1403 dd6d40094782
child 1405 0b9cd761a356
Fixed Exception dialog crash when original exception contains unicode
Beremiz.py
--- a/Beremiz.py	Sat Mar 29 19:03:00 2014 +0100
+++ b/Beremiz.py	Mon Mar 31 00:27:05 2014 +0200
@@ -1142,7 +1142,7 @@
 
 Traceback:
 """) % bug_report_path +
-        str(e_type) + " : " + str(e_value), 
+        repr(e_type) + " : " + repr(e_value), 
         _("Error"),
         trcbck_lst)
     try:
@@ -1194,7 +1194,10 @@
                     exception_locals = last_tb.tb_frame.f_locals # the locals at the level of the stack trace where the exception actually occurred
                     info['locals'] = format_namespace(exception_locals)
                     if 'self' in exception_locals:
-                        info['self'] = format_namespace(exception_locals['self'].__dict__)
+                        try :
+                            info['self'] = format_namespace(exception_locals['self'].__dict__)
+                        except :
+                            pass
                 
                 output = open(bug_report_path,'w')
                 lst = info.keys()