Skip Menu |

This queue is for tickets about the PDF-API2 CPAN distribution.

Report information
The Basics
Id: 118717
Status: resolved
Priority: 0/
Queue: PDF-API2

People
Owner: Nobody in particular
Requestors: jv [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.030
Fixed in: 2.031



Subject: Unguarded open in saveas
PDF/API2.pm, line 949, routine saveas, the open, print and close are not checked for errors. This may lead to mysterious messages and loss of data. A user of mine encountered this on Windows, where the program issued (for him) ununderstandable messages like: binmode() on closed filehandle OUTF printf on closed filehandle OUTF The culprit was another program that kept the pdf file open so it could not be rewritten.
Thanks for the report. I've added an "or die..." to the "open" call in open() and saveas(), which will give a more useful error. On Fri Nov 11 09:19:39 2016, JV wrote: Show quoted text
> PDF/API2.pm, line 949, routine saveas, the open, print and close are > not checked for errors. This may lead to mysterious messages and loss > of data. > > A user of mine encountered this on Windows, where the program issued > (for him) ununderstandable messages like: > > binmode() on closed filehandle OUTF > printf on closed filehandle OUTF > > The culprit was another program that kept the pdf file open so it > could not be rewritten.