> The close method is defined and flushing and closing a file, so > > it should not return until that's done. > > > > What command are you using to create the temp file? > > re command to write the file: f=open(fn,'w') ... then create HTML text in a string f.write(html) f.close