title: How to delete canvas file in reportlab?
body: <p>My Python program uses reportlab library to generate temporary PDF file for further merging it with existing file:</p>
  
  <pre><code>&gt; from reportlab.pdfgen import canvas 
  &gt; temp = canvas.Canvas("e:\\temp.pdf")
  &gt; ...
  &gt; temp.save()
  </code></pre>
  
  <p>The problem I have is I don't know how to delete this temporary file in a correct way. Whenever I try to to do it through os.remove, it restricts access because the file is already busy with my program. Also I fail to find out the correct way to do it via Reportlab methods.</p>
  
  <blockquote>
    <p>[WinError 32] The process cannot access the file because it is being
    used by another process:</p>
  </blockquote>