mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Fix for issue #816616: PDF Output Too many open files.
This commit is contained in:
parent
cf3b7f85ce
commit
123991aea5
1 changed files with 4 additions and 3 deletions
|
|
@ -198,9 +198,10 @@ def _write(self):
|
|||
try:
|
||||
outPDF = PdfFileWriter(title=self.metadata.title, author=self.metadata.author)
|
||||
for item in self.combine_queue:
|
||||
inputPDF = PdfFileReader(open(item, 'rb'))
|
||||
for page in inputPDF.pages:
|
||||
outPDF.addPage(page)
|
||||
with open(item, 'rb') as item_stream:
|
||||
inputPDF = PdfFileReader(item_stream)
|
||||
for page in inputPDF.pages:
|
||||
outPDF.addPage(page)
|
||||
outPDF.write(self.out_stream)
|
||||
finally:
|
||||
self._delete_tmpdir()
|
||||
|
|
|
|||
Loading…
Reference in a new issue