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

Recursion Error when outputting merged PDF File #268

Closed
jeffreycentex opened this issue Jun 9, 2016 · 2 comments
Closed

Recursion Error when outputting merged PDF File #268

jeffreycentex opened this issue Jun 9, 2016 · 2 comments
Labels
is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF PdfMerger The PdfMerger component is affected

Comments

@jeffreycentex
Copy link

I have a script that basically combines files into one PDF. Normally it works properly, but the last few days I have had the following failure and don't know where to start:

Uncaught exception
Traceback (most recent call last):
File "C:\gitlab\payerpath\payerpath-combine.py", line 130, in
mergedfile.write(outputfile)
File "C:\Anaconda\lib\site-packages\PyPDF2\merger.py", line 230, in write
self.output.write(fileobj)
File "C:\Anaconda\lib\site-packages\PyPDF2\pdf.py", line 482, in write
self._sweepIndirectReferences(externalReferenceMap, self._root)
File "C:\Anaconda\lib\site-packages\PyPDF2\pdf.py", line 571, in _sweepIndirectReferences
self._sweepIndirectReferences(externMap, realdata)
File "C:\Anaconda\lib\site-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences
value = self._sweepIndirectReferences(externMap, value)
File "C:\Anaconda\lib\site-packages\PyPDF2\pdf.py", line 571, in _sweepIndirectReferences
self._sweepIndirectReferences(externMap, realdata)
File "C:\Anaconda\lib\site-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences
value = self._sweepIndirectReferences(externMap, value)

---- repeat the last 4 lines about 700 times ---

File "C:\Anaconda\lib\site-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences
value = self._sweepIndirectReferences(externMap, value)
File "C:\Anaconda\lib\site-packages\PyPDF2\pdf.py", line 571, in _sweepIndirectReferences
self._sweepIndirectReferences(externMap, realdata)
File "C:\Anaconda\lib\site-packages\PyPDF2\pdf.py", line 552, in _sweepIndirectReferences
data[key] = value
File "C:\Anaconda\lib\site-packages\PyPDF2\generic.py", line 502, in setitem
if not isinstance(key, PdfObject):
RuntimeError: maximum recursion depth exceeded in instancecheck

No other errors.

Any hidden setting that could help with this one?

@patroqueeet
Copy link

+1

@MartinThoma MartinThoma added is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF PdfMerger The PdfMerger component is affected labels Apr 7, 2022
MartinThoma added a commit that referenced this issue Apr 23, 2022
This doesn't solve the issue, but it might make it
less severe.

See #520
See #268
See virantha/pypdfocr#59

Co-authored-by: danniesim <[email protected]>
MartinThoma added a commit that referenced this issue Apr 23, 2022
This doesn't solve the issue, but it might make it less severe.

See #520
See #268
See virantha/pypdfocr#59

sfneal@3558a69

Co-authored-by: danniesim <[email protected]>
dsk7 pushed a commit to montaggroup/PyPDF2 that referenced this issue Apr 23, 2022
This doesn't solve the issue, but it might make it less severe.

See py-pdf#520
See py-pdf#268
See virantha/pypdfocr#59

sfneal@3558a69

Co-authored-by: danniesim <[email protected]>
VictorCarlquist pushed a commit to VictorCarlquist/PyPDF2 that referenced this issue Apr 29, 2022
This doesn't solve the issue, but it might make it less severe.

See py-pdf#520
See py-pdf#268
See virantha/pypdfocr#59

sfneal@3558a69

Co-authored-by: danniesim <[email protected]>
@MartinThoma
Copy link
Member

Thank you for reporting this issue ❤️

I cannot reproduce this issue. As the code base has charged quite a bit, I'll close this issue.

Please let me know if you still see this in the latest PyPDF2 version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF PdfMerger The PdfMerger component is affected
Projects
None yet
Development

No branches or pull requests

3 participants