Skip to content

Commit

Permalink
ROB: Handle recursion error (#804)
Browse files Browse the repository at this point in the history
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 <geemee@gmail.com>
  • Loading branch information
MartinThoma and danniesim committed Apr 23, 2022
1 parent 40df4d7 commit 3d65938
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PyPDF2/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ def _sweepIndirectReferences(self, externMap, data):
newobj = self._sweepIndirectReferences(externMap, newobj)
self._objects[idnum-1] = newobj
return newobj_ido
except ValueError:
except (ValueError, RecursionError):
# Unable to resolve the Object, returning NullObject instead.
warnings.warn("Unable to resolve [{}: {}], returning NullObject instead".format(
data.__class__.__name__, data
Expand Down

0 comments on commit 3d65938

Please sign in to comment.