From a636cbcfd42024cc0b260cce3e5d48c451e53323 Mon Sep 17 00:00:00 2001 From: Kohei YOSHIDA Date: Tue, 20 Feb 2018 13:42:09 +0900 Subject: [PATCH] fix type of an argument to PDFFont#decode to bytes in py3 --- pdfminer/pdfdevice.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pdfminer/pdfdevice.py b/pdfminer/pdfdevice.py index 9435101..dfdc930 100644 --- a/pdfminer/pdfdevice.py +++ b/pdfminer/pdfdevice.py @@ -1,3 +1,6 @@ +# -*- coding: utf-8 -*- + +import six from .pdffont import PDFUnicodeNotDefined @@ -142,8 +145,9 @@ class TagExtractor(PDFDevice): font = textstate.font text = '' for obj in seq: - obj = utils.make_compat_str(obj) - if not isinstance(obj, str): + if isinstance(obj, six.text_type): + obj = utils.make_compat_bytes(obj) + if not isinstance(obj, six.binary_type): continue chars = font.decode(obj) for cid in chars: