Skip to content

'PdfReadWarning: incorrect startxref pointer' logs when no issue is found #852

@jessj52

Description

@jessj52

Hello! I noticed a new-to-me PdfReadWarning warning this afternoon after upgrading PyPDF2 (version 1.27.10):
PdfReadWarning: incorrect startxref pointer(0) [_reader.py:938] (source)

I tested with my own PDFs, and also the files from PDF_Samples in this repo. This warning seems to log on every PDF I attempt to read via:

from PyPDF2 import PdfFileReader
pdf_path = 'some-path/file.pdf'
with open(pdf_path, "rb") as pdf:
  pdf_reader = PdfFileReader(pdf)

It looks like the value being returned by _get_xref_issues() is 0, but there's a comment at the top of this method that says a return value of 0 means no issues were found. I haven't noticed any other issues (my script actually still runs just fine!), so I think it's just an over-zealous warning.

Metadata

Metadata

Assignees

Labels

is-bugFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions