[python-win32] os.remove not deleting a file
Henk Zevenhuizen
henk.zevenhuizen at gmail.com
Tue Oct 31 09:16:45 EDT 2017
Hi there,
This is my first mail to this list and i have a huge problem.
my os.remove(filename) is not working.
i am running python27 32 bits on a windows 10 64 bits machine
My piece of code (with debugging statements):
raw_input('before...')
print 73, (os.path.join(VERWERKTDIR, orgname))
if os.path.isfile(os.path.join(VERWERKTDIR, orgname)):
os.remove(os.path.join(VERWERKTDIR, orgname))
raw_input('after...')
print 'file removed'
else:
print 'no file present''
if there is a file to be removed i can see the print 'file removed' however
the file is still there
when i get the message : 'before' i can delete the file through windows
explorer and with CTRL-Z i can restore the file
then i press <Enter> to continue the raw_input('before...')
Then i get the message: "after", the file is still there and i cannot
delete the through windows explorer (permission denied)
the only way to delete the file is killing python
I don't have the slightest idea where to look
Has anyone any idea ??
thanks in advance
Henk Zevenhuizen
Holland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20171031/5c355071/attachment.html>
More information about the python-win32
mailing list