From 2192e81ae9e435a28874641ce5734e511fb9c974 Mon Sep 17 00:00:00 2001 From: nfnty Date: Wed, 1 Feb 2017 23:55:55 +0100 Subject: gui.curses_shortcuts: addstr, addnstr: Handle `UnicodeError` Fixes #787 --- ranger/gui/curses_shortcuts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ranger/gui/curses_shortcuts.py b/ranger/gui/curses_shortcuts.py index 3d2b7d18..78aad240 100644 --- a/ranger/gui/curses_shortcuts.py +++ b/ranger/gui/curses_shortcuts.py @@ -41,7 +41,7 @@ class CursesShortcuts(SettingsAware): try: self.win.addstr(*_fix_surrogates(args)) - except curses.error: + except (curses.error, UnicodeError): pass def addnstr(self, *args): @@ -55,7 +55,7 @@ class CursesShortcuts(SettingsAware): try: self.win.addnstr(*_fix_surrogates(args)) - except curses.error: + except (curses.error, UnicodeError): pass def addch(self, *args): -- cgit 1.4.1-2-gfad0