Skip to content

fix: suppress pypdf EOF warnings in test output#155

Merged
dholbach merged 1 commit into
mainfrom
fix/pypdf-eof-warnings
Jul 2, 2026
Merged

fix: suppress pypdf EOF warnings in test output#155
dholbach merged 1 commit into
mainfrom
fix/pypdf-eof-warnings

Conversation

@dholbach

@dholbach dholbach commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • pypdf emits "EOF marker not found" via warnings.warn() for slightly malformed PDFs it can still parse
  • These leaked into the Django test output as noise between the dots after fix: preserve image EXIF orientation and PDF /Rotate through compression #154 added pypdf calls
  • Fix: wrap PdfReader calls in warnings.catch_warnings() / simplefilter("ignore") inside _read_page_rotations and _restore_page_rotations — the surrounding try/except already handles actual read failures, so suppressing the warnings is safe

Test plan

  • Run ./dev.py test and confirm no "EOF marker not found" lines in output

🤖 Generated with Claude Code

pypdf emits "EOF marker not found" via warnings.warn() for slightly
malformed PDFs it can still parse. These leaked into test output as
noise. Wrap the PdfReader calls in warnings.catch_warnings() since the
existing try/except already handles actual read failures.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dholbach dholbach merged commit fbf0848 into main Jul 2, 2026
1 check passed
@dholbach dholbach deleted the fix/pypdf-eof-warnings branch July 2, 2026 18:52
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.

1 participant