# HG changeset patch # User Surkov Sergey # Date 1485511465 -10800 # Node ID 91b7cc4b0d44bfbe6794cad3a361f7f3b98b1d99 # Parent 976ce8c6195d80a44cc13820cd8cefb99eed1608 change directory for saving Beremiz bug reports from current working directory to TEMP directory. diff -r 976ce8c6195d -r 91b7cc4b0d44 Beremiz.py --- a/Beremiz.py Thu Jan 26 17:16:54 2017 +0300 +++ b/Beremiz.py Fri Jan 27 13:04:25 2017 +0300 @@ -1229,6 +1229,10 @@ ex = (last_tb.tb_frame.f_code.co_filename, last_tb.tb_frame.f_lineno) if ex not in ignored_exceptions: date = time.ctime() + try: + os.mkdir(path) + except OSError: + pass bug_report_path = path+os.sep+"bug_report_"+date.replace(':','-').replace(' ','_')+".txt" result = Display_Exception_Dialog(e_type,e_value,e_traceback,bug_report_path) if result: @@ -1261,6 +1265,7 @@ lst.sort() for a in lst: output.write(a+":\n"+str(info[a])+"\n\n") + output.close() #sys.excepthook = lambda *args: wx.CallAfter(handle_exception, *args) sys.excepthook = handle_exception @@ -1281,7 +1286,8 @@ if __name__ == '__main__': # Install a exception handle for bug reports - AddExceptHook(os.getcwd(),version.app_version) + logpath = tempfile.gettempdir()+os.sep+'Beremiz' + AddExceptHook(logpath ,version.app_version) frame = Beremiz(None, projectOpen, buildpath) if splash: