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

Check the obj type before calling the in operation #451

Merged
merged 3 commits into from
Jul 5, 2020

Conversation

tongbaojia
Copy link
Contributor

@tongbaojia tongbaojia commented Jul 1, 2020

  • Type check fix
  • The object can be of type byte instead of PDFStream.
    Without this type check, a python TypeError can be raised.
    In the case that raised the error, the obj turns out to be of class bytes.
  • Fixes Type check for obj in PDFPageInterpreter #441

How Has This Been Tested?

Test passing locally using this branch.

Checklist

  • I have added tests that prove my fix is effective or that my feature
    works
  • I have added docstrings to newly created methods and classes
  • I have optimized the code at least one time after creating the initial
    version
  • I have updated the README.md or I am verified that this
    is not necessary
  • I have updated the readthedocs documentation or I
    verified that this is not necessary
  • I have added a consice human-readable description of the change to
    CHANGELOG.md

@tongbaojia tongbaojia changed the title Develop Check the obj type before calling the in operation Jul 1, 2020
@pietermarsman
Copy link
Member

I don't like that we scatter all these isinstance(obj, PDFStream) checks over the code base. But up until now that seems to be the fix for these kind of issues, so for now its ok.

Thanks for figuring this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type check for obj in PDFPageInterpreter
2 participants