-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Infinite Recursion With PyPDF 4.1.0 in xml2rfc #2508
Labels
generic
The generic submodule is affected
is-question
Rather a question than an issue. Should usually be a Discussion instead
Comments
the xml2rfc code uses a "bad trick" to identify DictionnaryObject using
This is not an issue in pypdf |
On March 8, 2024 8:27:52 PM UTC, pubpub-zz ***@***.***> wrote:
the xml2rfc code uses a "bad trick" to identify DictionnaryObject using `hasattr(obj, 'keys')` : with #2464, functions of referenced object by IndirectObject are directly available in it.
proposed fix in walkpdf.py:
```
def walk(obj, seen):
dobj = {} # Direct objects
iobj = [] # Indirect objects
if isinstance(obj, pypdf.generic.DictionaryObject): #<-----
(...)
```
This is not an issue in pypdf
Thanks for checking. I have a related issue open with xml2rfc and I'll follow up with them.
Scott K
|
1 task
Now tested and this does resolve the issue. |
stefan6419846
added
the
is-question
Rather a question than an issue. Should usually be a Discussion instead
label
Mar 9, 2024
kesara
added a commit
to kesara/xml2rfc
that referenced
this issue
Mar 11, 2024
This fixes the recursion issue in walkpdf introduced by PyPDF==4.1.0. This fix is based @pubpub-zz's suggesion in py-pdf/pypdf#2508 (comment) Fixes ietf-tools#1111
kesara
added a commit
to kesara/xml2rfc
that referenced
this issue
Mar 11, 2024
This fixes the recursion issue in walkpdf introduced by PyPDF==4.1.0. This fix is based @pubpub-zz's suggestion in py-pdf/pypdf#2508 (comment) Fixes ietf-tools#1111
kesara
added a commit
to kesara/xml2rfc
that referenced
this issue
Mar 11, 2024
This fixes the recursion issue in walkpdf introduced by PyPDF==4.1.0. This fix is based @pubpub-zz's suggestion in py-pdf/pypdf#2508 (comment) Fixes ietf-tools#1111
kesara
added a commit
to ietf-tools/xml2rfc
that referenced
this issue
Mar 11, 2024
This fixes the recursion issue in walkpdf introduced by PyPDF==4.1.0. This fix is based @pubpub-zz's suggestion in py-pdf/pypdf#2508 (comment) Fixes #1111
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
generic
The generic submodule is affected
is-question
Rather a question than an issue. Should usually be a Discussion instead
Replace this: What happened? What were you trying to achieve?
Environment
Code + PDF
I don't have one. It's in the xml2rfc tests. It's not clear if this is an xml2rfc issue that was highlighted by a change in 4.1.0 or a pypdf regression. If needed, I can try to be more specific.
Traceback
This is an extract from the traceback I see (the line 21, line 21, line 29 patter repeats hundreds of times):
Related xml2rfc issue:
ietf-tools/xml2rfc#1111
The text was updated successfully, but these errors were encountered: