-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
is-bugFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF
Description
We process dozens of PDF files per day in our automated script that uses PyPDF2 version 1.21 as part of its process. A few files have been failing with the error pasted below. I can provide the PDF file that is having this error, just let me know how you would like me to send it. Thanks!
PdfReadWarning: Invalid stream (index 0) within object 62 0: Stream has ended unexpectedly [pdf.py:1128]
Traceback (most recent call last):
File "d:\scripts\mtx-coverpage\mtx-coverpage.py", line 99, in <module>
addpage.write(outfile)
File "D:\bin\Python27\lib\site-packages\PyPDF2\merger.py", line 209, in write
self.output.write(fileobj)
File "D:\bin\Python27\lib\site-packages\PyPDF2\pdf.py", line 277, in write
self._sweepIndirectReferences(externalReferenceMap, self._root)
File "D:\bin\Python27\lib\site-packages\PyPDF2\pdf.py", line 365, in _sweepIndirectReferences
self._sweepIndirectReferences(externMap, realdata)
File "D:\bin\Python27\lib\site-packages\PyPDF2\pdf.py", line 341, in _sweepIndirectReferences
value = self._sweepIndirectReferences(externMap, value)
File "D:\bin\Python27\lib\site-packages\PyPDF2\pdf.py", line 365, in _sweepIndirectReferences
self._sweepIndirectReferences(externMap, realdata)
File "D:\bin\Python27\lib\site-packages\PyPDF2\pdf.py", line 341, in _sweepIndirectReferences
value = self._sweepIndirectReferences(externMap, value)
File "D:\bin\Python27\lib\site-packages\PyPDF2\pdf.py", line 350, in _sweepIndirectReferences
value = self._sweepIndirectReferences(externMap, data[i])
File "D:\bin\Python27\lib\site-packages\PyPDF2\pdf.py", line 365, in _sweepIndirectReferences
self._sweepIndirectReferences(externMap, realdata)
File "D:\bin\Python27\lib\site-packages\PyPDF2\pdf.py", line 341, in _sweepIndirectReferences
value = self._sweepIndirectReferences(externMap, value)
File "D:\bin\Python27\lib\site-packages\PyPDF2\pdf.py", line 379, in _sweepIndirectReferences
newobj = self._sweepIndirectReferences(externMap, newobj)
File "D:\bin\Python27\lib\site-packages\PyPDF2\pdf.py", line 341, in _sweepIndirectReferences
value = self._sweepIndirectReferences(externMap, value)
File "D:\bin\Python27\lib\site-packages\PyPDF2\pdf.py", line 370, in _sweepIndirectReferences
newobj = data.pdf.getObject(data)
File "D:\bin\Python27\lib\site-packages\PyPDF2\pdf.py", line 1149, in getObject
retval = self._getObjectFromStream(indirectReference)
File "D:\bin\Python27\lib\site-packages\PyPDF2\pdf.py", line 1131, in _getObjectFromStream
raise utils.PdfReadError("Can't read object stream: %s"%e)
PyPDF2.utils.PdfReadError: Can't read object stream: Stream has ended unexpectedlyReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
is-bugFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDFFrom a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF