From 4fa88c1ba38b34f9750625458c465d66f6531bc3 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 25 Oct 2019 09:53:44 -0700 Subject: [PATCH] clear out non-ascii chars from data --- jc/parsers/history.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jc/parsers/history.py b/jc/parsers/history.py index a2b02450..a272c236 100644 --- a/jc/parsers/history.py +++ b/jc/parsers/history.py @@ -19,7 +19,8 @@ $ history | jc --history -p def parse(data): output = {} - linedata = data.splitlines() + # split lines and clear out any non-ascii chars + linedata = data.splitlines().encode('ascii', errors='ignore').decode() # Clear any blank lines cleandata = list(filter(None, linedata))