香槟酒 <[EMAIL PROTECTED]> added the comment:

Thank you for your reply.I mean I used gvim to open a file. the Python
manual did not specify how to use a file, but said that if a file is to be
used, the deletion of the file will be exception to be raise.so when I use
gvim to open a file, then run os.remove () method to remove the file, the
file is deleted, and no exception to be raise.

2008/7/28 Facundo Batista <[EMAIL PROTECTED]>

>
> Facundo Batista <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
> <http://bugs.python.org/issue3455>
> _______________________________________
>

Added file: http://bugs.python.org/file10994/unnamed

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3455>
_______________________________________
<div dir="ltr"><div dir="ltr">Thank you for your reply.I mean I used gvim to 
open a file. the Python manual did not specify how to use a file, but said that 
if 
a file is to be used, the deletion of the file will be exception to be raise.so 
when I use gvim to open a file, then run os.remove () method to 
remove the file, the file is deleted, and no exception to be 
raise.</div><br><br><div class="gmail_quote">2008/7/28 Facundo Batista <span 
dir="ltr">&lt;<a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Facundo Batista &lt;<a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>&gt; added the comment:<br>
<br>
zkfarmer, please try the following from your IDLE:<br>
<br>
&gt;&gt;&gt; myfilename = r&quot;c:\tmp\test.txt&quot;<br>
&gt;&gt;&gt; fh = open(myfilename, &quot;w&quot;)<br>
&gt;&gt;&gt; fh.write(&quot;test\n&quot;)<br>
&gt;&gt;&gt; fh.close()<br>
&gt;&gt;&gt; fh = open(myfilename)<br>
&gt;&gt;&gt; import os<br>
&gt;&gt;&gt; os.remove(myfilename)<br>
<br>
Traceback (most recent call last):<br>
 &nbsp;File &quot;&lt;pyshell#6&gt;&quot;, line 1, in &lt;module&gt;<br>
 &nbsp; &nbsp;os.remove(myfilename)<br>
WindowsError: [Error 32] The process cannot access the file because it<br>
is being used by another process: &#39;c:\\tmp\\test.txt&#39;<br>
&gt;&gt;&gt;<br>
<br>
...and copy here what happened.<br>
<br>
Thanks!<br>
<br>
----------<br>
nosy: +facundobatista<br>
<div><div></div><div class="Wj3C7c"><br>
_______________________________________<br>
Python tracker &lt;<a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>&gt;<br>
&lt;<a href="http://bugs.python.org/issue3455"; 
target="_blank">http://bugs.python.org/issue3455</a>&gt;<br>
_______________________________________<br>
</div></div></blockquote></div><br></div>
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to