Skip to content

fix: warn instead of raising KeyError for an unknown page label style - #749

Closed
RavSinghChandan wants to merge 1 commit into
pikepdf:mainfrom
RavSinghChandan:fix-unknown-page-label-style
Closed

RavSinghChandan wants to merge 1 commit into
pikepdf:mainfrom
RavSinghChandan:fix-unknown-page-label-style

Conversation

@RavSinghChandan

Copy link
Copy Markdown
Contributor

Reading page.label raised KeyError: 'Z' when a page label dictionary had a style name outside D, R, r, A, a (for example /S /Z). A style that is not a name already warns "Page label dictionary has invalid page label style" and keeps the prefix; an unknown name now does the same, so one malformed label no longer stops code that lists page labels.

Added a case to test_page_label_dicts and a release note.

AI-assisted (Claude Code); I reviewed and tested the change.

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.38%. Comparing base (bdfecdc) to head (6beda63).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #749      +/-   ##
==========================================
- Coverage   92.38%   92.38%   -0.01%     
==========================================
  Files         112      112              
  Lines       15489    15488       -1     
  Branches      836      836              
==========================================
- Hits        14309    14308       -1     
  Misses       1180     1180              

☔ View full report in Codecov by Harness.
📢 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.

@RavSinghChandan
RavSinghChandan force-pushed the fix-unknown-page-label-style branch from 6beda63 to 0b9e1ce Compare October 19, 2026 06:44
@jbarlow83

Copy link
Copy Markdown
Member

Thanks! This was merged to main as 6beda63, so I'm closing the PR.

@jbarlow83 jbarlow83 closed this Nov 1, 2026
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.

2 participants