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

Bug: Assertion error resulting in the abortion of extraction #53

Closed
chrisgrieser opened this issue Jan 12, 2022 · 3 comments
Closed

Bug: Assertion error resulting in the abortion of extraction #53

chrisgrieser opened this issue Jan 12, 2022 · 3 comments

Comments

@chrisgrieser
Copy link

chrisgrieser commented Jan 12, 2022

This looks look a similar case like issue #48.

Once again, I have a PDF file which is a book scan, and get a warning about popup annotations not being supported. And instead of continuing, an Assertion Error results in the abortion of the annotation extraction.

This time, I couldn't break it down to a particular page – the issue seems to occur regardless of the page tried. I have therefore attached a sample of 10 pages, and the log I get.

sample.pdf

WARNING: Unsupported annotation subtype: /'Popup'
WARNING: Unsupported annotation subtype: /'Popup'
Traceback (most recent call last):
  File "/opt/homebrew/bin/pdfannots", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/lib/python3.9/site-packages/pdfannots/cli.py", line 141, in main
    doc = process_file(
  File "/opt/homebrew/lib/python3.9/site-packages/pdfannots/__init__.py", line 472, in process_file
    page.annots.sort()
  File "/opt/homebrew/lib/python3.9/site-packages/pdfannots/types.py", line 226, in __lt__
    return self.pos < other.pos
  File "/opt/homebrew/lib/python3.9/site-packages/pdfannots/types.py", line 182, in __lt__
    assert self._pageseq != 0
AssertionError
@0xabu
Copy link
Owner

0xabu commented Jan 12, 2022

Yes, that looks exactly like #48. Which version of pdfannots are you using? I notice you've installed it from a package (e.g. from PyPI), but the warning about Popup annotations is removed in the latest version, so I wonder whether you are missing the fix I made for that issue.

@0xabu
Copy link
Owner

0xabu commented Jan 12, 2022

Indeed, your sample works fine for me. Please reopen if you can repro on the latest version.

@chrisgrieser
Copy link
Author

ah yes indeed, I was still on 0.2. After updating to 0.3, everything works.

thanks and sorry for the waste of time!

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

No branches or pull requests

2 participants