A memo as a memorandum. I couldn't reach the answer even if I googled, so I'll leave it just in case.
In rare cases, ʻexception stack overflow!` Occurs when copying a PDF using PyMuPDF.
new_doc = fitz.open()
new_doc.insertPDF(docsrc=old_doc, from_page=1, to_page=1)
mupdf: exception stack overflow!
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
・
・
・
File "/Users/ijufumi/workspaces/python_sample/.venv/lib/python3.6/site-packages/fitz/fitz.py", line 3581, in insertPDF
val = _fitz.Document_insertPDF(self, docsrc, from_page, to_page, start_at, rotate, links, annots)
RuntimeError: exception stack overflow!
Specify ʻannots = False when executing ʻinsertPDF
.
new_doc = fitz.open()
new_doc.insertPDF(docsrc=old_doc, from_page=1, to_page=1, annots=False)
I couldn't find it in the official docs, but I get this exception with some annotations.
If anyone finds it in the official documentation, I would appreciate it if you could comment.