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

readFromStream(stream, pdf) receives None and pdf.strict fails #81

Open
emelenas opened this issue Jun 24, 2020 · 0 comments
Open

readFromStream(stream, pdf) receives None and pdf.strict fails #81

emelenas opened this issue Jun 24, 2020 · 0 comments

Comments

@emelenas
Copy link

emelenas commented Jun 24, 2020

As stated in the title, pdf.strict in DictionaryObject.readFromStream (at line 667 in generic.py) raises an AttributeError because the parameter pdf as received is None.

Going back, this comes from ContentStream.__parseContentStream at file generic.py line 1027 though the call operands.append(readObject(stream, None)). readObject in turn calls DictionaryObject.readFromStream at line 65 of generic.py

Thus, it is an explicit call with None as an argument that causes the exception.

Anyhow if None is to be passed as argument pdf, I believe a check should be in order down the line to avoid exceptions.

I changed the call to

operands.append(readObject(stream, self.pdf))

and apparently no harm is done (aside from avoiding the exception).

Copied from py-pdf#563 since apparently no development there

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

No branches or pull requests

1 participant