summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-06-16 21:11:30 +0200
committerhut <hut@lavabit.com>2012-06-16 21:11:30 +0200
commit6a6c4d3e895da3bd71f7b543f61e7489760bb242 (patch)
tree8bb8bb70ccf3f3bbd96698c4d74cb1f10e1d4e3c /ranger
parenta9e6e3709d54cb495cc30384a48c534b691cb088 (diff)
downloadranger-6a6c4d3e895da3bd71f7b543f61e7489760bb242.tar.gz
widgets.console: catch a UnicodeEncodeError with surrogates
Diffstat (limited to 'ranger')
-rw-r--r--ranger/gui/widgets/console.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index 06552ef6..733e2b8b 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -58,7 +58,10 @@ class Console(Widget):
 				pass
 			else:
 				for entry in self.history_backup:
-					f.write(entry + '\n')
+					try:
+						f.write(entry + '\n')
+					except UnicodeEncodeError:
+						pass
 				f.close()
 
 	def draw(self):