-
Notifications
You must be signed in to change notification settings - Fork 21
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
"TypeError: 'NoneType' object is not subscriptable" almost every time I make inference #21
Comments
Can you share how you are using it and with which pdf file ? |
I found that if one of the pages doesn't contain text, this occurs. I'm able to avoid these documents like this:
|
I cannot reproduce the error, I checked both an empty pdf and a pdf with an empty page between non-empty pages. If it is possible you share the pdf I can check that one. Maybe there is a different problem. |
Here are some example files which fail. From some very cursory debugging it looks like the error was introduced when the eliot algorithm was added. TextOnlyDevices had some changes made to it that fail when certain assumptions are not met. Specifically, the below files are constructed in a manner where process_string never gets run when the PDF is being parsed. This in turn means that draw_cid never sets self.current_block. That leads recover_last_paragraph to fail when it tries to pull the fifth item from self.current_block, which is still set as SYSTEM V - application binary interface.pdf Taking_The_Pulse_Of_Hacking-A_Risk_Basis_For_Security_Research_2018.pdf |
Thanks for the pdfs. There are different issues with each of these.
|
This is a note to myself, I will try to improve the error logging a bit in the next version, so it will be a little more human friendly messages when errors happen. |
I have been processing hundreds of PDF files recently and have come across a large number of these. If you would like I can provide you more. There are also a range of unicode and other cid encoding errors I've come across that I've not reported since they seem to be with the underlying PDFMiner library. But, I'd be happy to share a range of PDF's that cause the library to fail out in different ways if you would like. |
Thanks, I will get in touch if I need more examples. Meanwhile I will create two different issues for the cases above, and also close this issue as it was first opened for empty pdfs which I could not reproduce. |
@seamustuohy update about the files you mentioned:
|
The text was updated successfully, but these errors were encountered: