From 6a6c4d3e895da3bd71f7b543f61e7489760bb242 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 16 Jun 2012 21:11:30 +0200 Subject: widgets.console: catch a UnicodeEncodeError with surrogates --- ranger/gui/widgets/console.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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): -- cgit 1.4.1-2-gfad0