Skip to content

Fix "Stream has ended unexpectedly" for Name Objects#211

Merged
mstamy2 merged 2 commits intopy-pdf:masterfrom
speedplane:master
Jun 30, 2015
Merged

Fix "Stream has ended unexpectedly" for Name Objects#211
mstamy2 merged 2 commits intopy-pdf:masterfrom
speedplane:master

Conversation

@speedplane
Copy link

Fix a bug which could result in a "Stream has ended unexpectedly" error being raised unnecessarily if a Name object runs right up against the end of a file stream.

I have a test case, but it's unfortunately very convoluted and will be quite difficult for me to get running in PyPDF. However, if one could somehow make a PDF with a inline stream object, and a Name object at the very end of the stream, then it would trigger this bug fix (not sure how to do that).

speedplane added 2 commits June 30, 2015 08:36
…or being raised unecessarily if a Name object runs right up against the end of a file stream.
@speedplane
Copy link
Author

After staring at that regex in the same function, I also made a few other minor fixes. Don't have a test case for them, but they seem pretty straightforward regex escape fixes. I would bet named objects were not working so well previously.

@mstamy2
Copy link
Collaborator

mstamy2 commented Jun 30, 2015

I had a few PDFs lying around that exhibited this behavior. Fix works well.

mstamy2 added a commit that referenced this pull request Jun 30, 2015
Fix "Stream has ended unexpectedly" for Name Objects
@mstamy2 mstamy2 merged commit 9022c7d into py-pdf:master Jun 30, 2015
@claird
Copy link
Contributor

claird commented Oct 8, 2015

Hello,

Thank you for your question, comments, and/or concerns regarding PyPDF2.
All of our PyPDF2 users are very important to us. Unfortunately at this
present time we are in the process of regrouping our office. Your
questions are very important to us but regretfully we will not be able to
address any issues regarding PyPDF2 until later this fall. However, if
this is an urgent matter and you need immediate assistance please respond
to this email and we will try our best to accommodate your needs sooner.
My apologies for the inconvenience. Thank you for your patience.

Sincerely,

Selma Kishwar

Phaseit, Inc.

selmaikishwar@gmail.com

On Tue, Jun 30, 2015 at 8:10 AM, Michael Sander notifications@github.com
wrote:

After staring at that regex in the same function, I also made a few other
minor fixes. Don't have a test case for them, but they seem pretty
straightforward regex escape fixes. I would bet named objects were not
working so well previously.


Reply to this email directly or view it on GitHub
#211 (comment).

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.

3 participants