Jul-27-2022, 03:38 PM
(This post was last modified: Jul-27-2022, 03:38 PM by deanhystad.)
pdfmerger is not leaving the file open, you are. Here you open a file and never close it.
merger.append(PdfFileReader(open(os.path.join(dirName, fname),'rb')))I would use a context manager to automatically close the file.
with open(os.path.join(dirName, fname),'rb') as file: merger.append(PdfFileReader(file))