From d59a1bda1a9b8ad6444d4658c065f6ebd4f88b5a Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 12 May 2015 15:57:01 -0500 Subject: [PATCH] Add exception catch for possible corner case on Linux --- fanficfare/htmlcleanup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fanficfare/htmlcleanup.py b/fanficfare/htmlcleanup.py index 7a807db6..eb284806 100644 --- a/fanficfare/htmlcleanup.py +++ b/fanficfare/htmlcleanup.py @@ -81,10 +81,10 @@ def removeEntities(text): try: t = text.decode('utf-8') - except UnicodeEncodeError, e: + except (UnicodeEncodeError,UnicodeDecodeError), e: try: t = text.encode ('ascii', 'xmlcharrefreplace') - except UnicodeEncodeError, e: + except (UnicodeEncodeError,UnicodeDecodeError), e: t = text text = t # replace numeric versions of [&<>] with named versions,