From 28c2a4e6ad8a952f06978e8cfcacac63af6bb357 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Sep 2014 10:31:33 +0200 Subject: [PATCH] 2.7/3.4 encoding corrected --- tools/dumppdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/dumppdf.py b/tools/dumppdf.py index f33296a..7a46e68 100755 --- a/tools/dumppdf.py +++ b/tools/dumppdf.py @@ -18,7 +18,7 @@ from pdfminer.utils import isnumber ESC_PAT = re.compile(r'[\000-\037&<>()"\042\047\134\177-\377]') def e(s): - if isinstance(s,six.binary_type): + if six.PY3 and isinstance(s,six.binary_type): s=str(s,'latin-1') return ESC_PAT.sub(lambda m:'&#%d;' % ord(m.group(0)), s)