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

pypdf hangs on one specific PDF - cannot catch error with try/except #1825

Closed
amplicity opened this issue May 1, 2023 · 2 comments · Fixed by #1828
Closed

pypdf hangs on one specific PDF - cannot catch error with try/except #1825

amplicity opened this issue May 1, 2023 · 2 comments · Fixed by #1828

Comments

@amplicity
Copy link

amplicity commented May 1, 2023

pypdf freezes on one specific PDF. I get no error, and no succeed. I am not able to see what the error is.

Environment

Which environment were you using when you encountered the problem?

$ python -m platform
macOS-12.3.1-arm64-arm-64bit

$ python -c "import pypdf;print(pypdf.__version__)"
3.8.1

Code + PDF

This is a minimal, complete example that shows the issue:

from pypdf import PdfReader

reader = PdfReader("example.pdf")
number_of_pages = len(reader.pages)
page = reader.pages[0]
text = page.extract_text()

The PDF is shared below. This is a publicly-accessible PDF.

MiFO_LFO_FEIS_NOA_Published (3).pdf

Any thoughts as to why this particular pdf might hang?

exiledkingcc added a commit to exiledkingcc/pypdf that referenced this issue May 3, 2023
exiledkingcc added a commit to exiledkingcc/pypdf that referenced this issue May 3, 2023
exiledkingcc added a commit to exiledkingcc/pypdf that referenced this issue May 3, 2023
exiledkingcc added a commit to exiledkingcc/pypdf that referenced this issue May 8, 2023
exiledkingcc added a commit to exiledkingcc/pypdf that referenced this issue May 8, 2023
@MartinThoma MartinThoma changed the title PyPdf hangs on one specific pdf - cannot catch error with try/except pypdf hangs on one specific PDF - cannot catch error with try/except May 21, 2023
@MartinThoma
Copy link
Member

The fix was just merged and will be part of pypdf >= 3.9.0. It will be released today. A regression test was added.

@MartinThoma
Copy link
Member

@amplicity Thank you for reporting the issue. If you want, I can add you as a contributor: https://pypdf.readthedocs.io/en/latest/meta/CONTRIBUTORS.html

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 a pull request may close this issue.

2 participants