[issue3455] os.remove()method document error

Facundo Batista report at bugs.python.org
Mon Jul 28 14:15:13 CEST 2008


Facundo Batista <facundo at taniquetil.com.ar> added the comment:

zkfarmer, please try the following from your IDLE:

>>> myfilename = r"c:\tmp\test.txt"
>>> fh = open(myfilename, "w")
>>> fh.write("test\n")
>>> fh.close()
>>> fh = open(myfilename)
>>> import os
>>> os.remove(myfilename)

Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    os.remove(myfilename)
WindowsError: [Error 32] The process cannot access the file because it
is being used by another process: 'c:\\tmp\\test.txt'
>>> 

...and copy here what happened.

Thanks!

----------
nosy: +facundobatista

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3455>
_______________________________________


More information about the Python-bugs-list mailing list