Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type of an argument to PDFFont#decode to bytes in py3 #125

Merged
merged 1 commit into from
Mar 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pdfminer/pdfdevice.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-

import six

from .pdffont import PDFUnicodeNotDefined

Expand Down Expand Up @@ -142,8 +145,9 @@ def render_string(self, textstate, seq):
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:
Expand Down