Skip to content

add_page: also reject a NaN or infinite duration - #2109

Merged
andersonhc merged 2 commits into
py-pdf:masterfrom
RavSinghChandan:duration-finite
Nov 7, 2026
Merged

andersonhc merged 2 commits into
py-pdf:masterfrom
RavSinghChandan:duration-finite

Conversation

@RavSinghChandan

Copy link
Copy Markdown

add_page(duration=float("nan")) passed the duration < 0 check from #2090 and wrote /Dur nan into the page (/Dur inf for infinity), which is not a valid PDF number. Both now raise the existing ValueError.

  • A unit test is covering the code added / modified by this PR
  • A mention of the change is present in CHANGELOG.md
  • This PR is ready to be merged

# Conflicts:
#	CHANGELOG.md
@andersonhc
andersonhc merged commit fd78bc2 into py-pdf:master Nov 7, 2026
23 checks passed
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