Fixed crash when saving history with unicode URLs.

This commit is contained in:
Michael Lazar
2015-05-12 22:16:55 -07:00
parent b375fb71e7
commit c608e35b1e

View File

@@ -38,8 +38,11 @@ def save_history(history):
for i in range(200): for i in range(200):
if not history: if not history:
break 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): class OrderedSet(object):
""" """