-
Notifications
You must be signed in to change notification settings - Fork 561
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
RuntimeError: cycle in structure tree #2749
Comments
Sorry for the tardy response! It might be subject to interpretation, whether downgrading this problem to a warning would make sense though. As a circumvention, put text extraction in a try/except clause. text = []
for page in doc:
try:
text.append(page.get_text())
except RuntimeError: # make a temporary PDF with the problem page
temp = fitz.open()
temp.insert_pdf(doc, from_page=page.number, to_page=page.number)
text.append(temp[0].get_text())
temp.close() This will work in your case. |
Update from the MuPDF developers: |
With latest PyMuPDF and MuPDF the test case runs ok, with a warning "MuPDF error: cycle in structure tree". #2548 tests the same issue. |
tests/test_2548.py:test_2548() has been extended to check for the new behaviour in PyMuPDF-1.23.7, so marking this as fixed in next release. |
Hi! When building pymupdf 1.23.6 against mupdf 1.23.7 I get a failing test:
Can you point me to where this test is fixed as for rebuild purposes I will have to disable this now. |
Releases of PyMuPDF are only tested with a specific MuPDF, and are not tested or updated to work with later MuPDF releases. MuPDF often changes behaviour between its releases, so some test failures with later MuPDF releases are to be expected. In particular, PyMuPDF-1.23.6 was only tested with MuPDF-1.23.5. If you want to use MuPDF-1.23.7, you'll have to wait for our next release, PyMuPDF-1.23.7, which i'm hoping to make today or tomorrow. [Or you could try the latest PyMuPDF from git, which usually (but not always) works with the latest MuPDF from git (master and current release branche)]. |
Fixed in 1.23.7. |
Hi. In the newest version 1.23.5 am getting this error when reading specific pdfs (link to one of them are in the code below).
To Reproduce
This is my code:
configuration
The text was updated successfully, but these errors were encountered: