From c36cc90c2964bf2b43788fe50ff1b224248f03fa Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 25 Aug 2016 15:49:03 -0300 Subject: [PATCH] Python3 unicode In python3 we do not have unicode strings, so we do not need to decode them. --- scraperwiki/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scraperwiki/utils.py b/scraperwiki/utils.py index 4e76115..d056d2e 100644 --- a/scraperwiki/utils.py +++ b/scraperwiki/utils.py @@ -57,7 +57,13 @@ def pdftoxml(pdfdata, options=""): #xmlfin = open(tmpxml) xmldata = xmlin.read() xmlin.close() - return xmldata.decode('utf-8') + + try: + xmldata = xmldata.decode('utf-8') + except AttributeError: + pass + + return xmldata def _in_box():