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

BUG: PdfReader.get_fields() attempts to delete non-existing index "/Off" #1933

Merged
merged 2 commits into from
Jul 1, 2023

Conversation

dmjohnsson23
Copy link
Contributor

I encountered this bug while playing around with the library. Seemed like a fairly straightforward fix, but if there are issues with doing this, let me know.

pypdf/_reader.py Outdated Show resolved Hide resolved
@MartinThoma MartinThoma added the is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF label Jun 30, 2023
@codecov
Copy link

codecov bot commented Jun 30, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (014de9b) 92.85% compared to head (add6f4d) 92.85%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1933   +/-   ##
=======================================
  Coverage   92.85%   92.85%           
=======================================
  Files          34       34           
  Lines        7094     7094           
  Branches     1397     1397           
=======================================
  Hits         6587     6587           
  Misses        359      359           
  Partials      148      148           
Impacted Files Coverage Δ
pypdf/_reader.py 91.33% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MartinThoma MartinThoma changed the title Fix bug on PdfReader.get_fields() when "/Off" does not exist. BUG: PdfReader.get_fields() attempts to delete non-existing index "/Off" Jul 1, 2023
@MartinThoma MartinThoma merged commit 44790c4 into py-pdf:main Jul 1, 2023
@MartinThoma
Copy link
Member

Very nice work 👏 It will be released to PyPI with pypdf>3.11.1 tomorrow.

If you want, I can add you as a contributor: https://pypdf.readthedocs.io/en/latest/meta/CONTRIBUTORS.html :-)

MartinThoma added a commit that referenced this pull request Jul 2, 2023
New Features (ENH):
-  Add AES support for encrypting PDF files (#1918, #1935, #1936, #1938)
-  Add page deletion feature to PdfWriter (#1843)

Bug Fixes (BUG):
-  PdfReader.get_fields() attempts to delete non-existing index "/Off" (#1933)
-  Remove unused objects when cloning_from (#1926)
-  Add the TK.SIZE into the trailer (#1911)
-  add_named_destination() maintains named destination list sort order (#1930)
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants