diff options
author | hut <hut@lavabit.com> | 2012-06-16 21:11:30 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2012-06-16 21:11:30 +0200 |
commit | 6a6c4d3e895da3bd71f7b543f61e7489760bb242 (patch) | |
tree | 8bb8bb70ccf3f3bbd96698c4d74cb1f10e1d4e3c | |
parent | a9e6e3709d54cb495cc30384a48c534b691cb088 (diff) | |
download | ranger-6a6c4d3e895da3bd71f7b543f61e7489760bb242.tar.gz |
widgets.console: catch a UnicodeEncodeError with surrogates
-rw-r--r-- | ranger/gui/widgets/console.py | 5 |
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): |