this should be very simple question, for which I couldn\'t find answer by Google search: How to close file handle opened by pyPDF \"PdfFileReader\" Class
Here is sni
I would sugest to handle the file open out of the PdfFileReader
Your code will be:
import os.path from pyPdf import PdfFileReader fname = 'my.pdf' fh = file(fname, "rb") input = PdfFileReader(fh) fh.close() os.rename(fname, 'my_renamed.pdf')