changeset 265:043d71a192b5

* _ListItem in HistoryManager will now return a string object in __str__ * Editor will now print full exception when an exception occurs when opening a file
author cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 13 Jun 2009 15:08:42 +0000
parents ea85ddce2b36
children 475f83e227e0
files clients/editor/plugins/HistoryManager.py clients/editor/scripts/editor.py
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/clients/editor/plugins/HistoryManager.py	Sat Jun 13 14:54:42 2009 +0000
+++ b/clients/editor/plugins/HistoryManager.py	Sat Jun 13 15:08:42 2009 +0000
@@ -224,7 +224,7 @@
 				self.parent = parent
 				
 			def __str__(self):
-				return self.str
+				return self.str.encode("utf-8")
 		
 		while item is not None:
 			listitem = _ListItem(u" "*indention + branchstr + " " + item.object.name, item, parent)
--- a/clients/editor/scripts/editor.py	Sat Jun 13 14:54:42 2009 +0000
+++ b/clients/editor/scripts/editor.py	Sat Jun 13 15:08:42 2009 +0000
@@ -16,7 +16,7 @@
 from gui.error import ErrorDialog
 from settings import Settings
 from pychan.tools import callbackWithArguments as cbwa
-import sys
+import sys, traceback
 
 def getEditor():
 	""" Returns the Global editor instance """
@@ -320,8 +320,9 @@
 			map = loaders.loadMapFile(path, self.engine)
 			return self.newMapView(map)
 		except:
+			traceback.print_exc(sys.exc_info()[1])
 			errormsg = u"Opening map failed:\n"
-			errormsg += u"File: "+unicode(path)+"\n"
+			errormsg += u"File: "+unicode(path, sys.getfilesystemencoding())+u"\n"
 			errormsg += u"Error: "+unicode(sys.exc_info()[1])
 			ErrorDialog(errormsg)
 			return None