pefile icon indicating copy to clipboard operation
pefile copied to clipboard

Fail to delete file after pefile?

Open kurtqiao opened this issue 9 years ago • 2 comments

after i use pefile, found fail to delete control_file

  1. control_file=os.path.join(tempfolder, myfile) pe = pefile.PE(control_file) check some digital sign information
  2. and then try to delete the tmp file by using os.remove(myfile) or shutil.rmtree(tempfolder) i got windows error 32, fail to remove file

i guess i have to use pe.close before remove my file, but still fail. any ideas about this issue? thank you!

kurtqiao avatar Jun 27 '16 03:06 kurtqiao

pefile uses mmap to access the file. You will likely need to pe.close(), or exit the process before you can delete the file.

stephenrauch avatar Jul 04 '16 23:07 stephenrauch

Same problem here. pe.close() worked for me

lyricnz avatar Sep 25 '17 00:09 lyricnz