Skip to content

Conversation

badGarnet
Copy link
Contributor

@badGarnet badGarnet commented Aug 4, 2025

This PR fixes #3419 by checking if key /D exists in a link object before creating link referencing this key.

test

A minimum test file is added and a test is added to this PR. Without this change the test will yield KeyError.

@badGarnet badGarnet changed the title fix: fix issue 3419 #3419 check if key exists in link object before referencing it Aug 4, 2025
@badGarnet badGarnet changed the title #3419 check if key exists in link object before referencing it #3419: check if key exists in link object before referencing it Aug 4, 2025
@badGarnet badGarnet changed the title #3419: check if key exists in link object before referencing it BUG: check if key exists in link object before referencing it Aug 4, 2025
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.98%. Comparing base (8000cbe) to head (5d786d8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3420   +/-   ##
=======================================
  Coverage   96.98%   96.98%           
=======================================
  Files          55       55           
  Lines        9340     9342    +2     
  Branches     1708     1709    +1     
=======================================
+ Hits         9058     9060    +2     
  Misses        168      168           
  Partials      114      114           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stefan6419846 stefan6419846 changed the title BUG: check if key exists in link object before referencing it ROB: Skip Go-To actions without a destination Aug 4, 2025
@badGarnet badGarnet requested a review from stefan6419846 August 4, 2025 17:02
Copy link
Collaborator

@stefan6419846 stefan6419846 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@stefan6419846 stefan6419846 merged commit 1b3177b into py-pdf:main Aug 5, 2025
16 checks passed
stefan6419846 added a commit that referenced this pull request Aug 11, 2025
## What's new

### Security (SEC)
- Limit decompressed size for FlateDecode filter (#3430) by @stefan6419846

### Deprecations (DEP)
- Drop Python 3.8 support (#3412) by @stefan6419846

### New Features (ENH)
- Move BlackIs1 functionality to tiff_header (#3421) by @j-t-1

### Robustness (ROB)
- Skip Go-To actions without a destination (#3420) by @badGarnet

### Developer Experience (DEV)
- Update code style related libraries (#3414) by @stefan6419846
- Update mypy to 1.17.0 (#3413) by @stefan6419846
- Stop testing on Python 3.8 and start testing on Python 3.14 (#3411) by @stefan6419846

### Maintenance (MAINT)
- Cleanup deprecations (#3424) by @stefan6419846

[Full Changelog](5.9.0...6.0.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

_build_link with some pdf lead to KeyError: '/D'
2 participants