summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/fm.py2
-rw-r--r--ranger/core/main.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/ranger/core/fm.py b/ranger/core/fm.py
index 9b5cc036..20327a71 100644
--- a/ranger/core/fm.py
+++ b/ranger/core/fm.py
@@ -212,6 +212,8 @@ class FM(Actions, SignalDispatcher):
 
 		finally:
 			if ranger.arg.choosedir and self.env.cwd and self.env.cwd.path:
+				# XXX: UnicodeEncodeError: 'utf-8' codec can't encode character
+				# '\udcf6' in position 42: surrogates not allowed
 				open(ranger.arg.choosedir, 'w').write(self.env.cwd.path)
 			self.bookmarks.remember(env.cwd)
 			self.bookmarks.save()
diff --git a/ranger/core/main.py b/ranger/core/main.py
index 14e4b1f6..b69e3c6d 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -127,7 +127,10 @@ def main():
 			print("ranger version: %s, executed with python %s" %
 					(ranger.__version__, sys.version.split()[0]))
 			print("Locale: %s" % '.'.join(str(s) for s in locale.getlocale()))
-			print("Current file: %s" % filepath)
+			try:
+				print("Current file: %s" % filepath)
+			except:
+				pass
 			print(crash_traceback)
 			print("ranger crashed.  " \
 				"Please report this traceback at:")