From c608e35b1e3bdb183b5bceaf7b37ba3f496c66ba Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Tue, 12 May 2015 22:16:55 -0700 Subject: [PATCH] Fixed crash when saving history with unicode URLs. --- rtv/history.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rtv/history.py b/rtv/history.py index 8db031e..1ca48fa 100644 --- a/rtv/history.py +++ b/rtv/history.py @@ -38,8 +38,11 @@ def save_history(history): for i in range(200): if not history: break - history_file.write(history.pop() + '\n') - + try: + history_file.write(history.pop() + '\n') + except UnicodeEncodeError: + # Ignore unicode URLS, may want to handle this at some point + continue class OrderedSet(object): """