On Wed, May 14, 2008 at 8:18 AM, Gabriel Genellina
<[EMAIL PROTECTED]> wrote:
> En Tue, 13 May 2008 11:57:03 -0300, Dmitry Teslenko <[EMAIL PROTECTED]>
>  Is the code above contained in a function? So all references are released
> upon function exit?

Yes, it's a function

>  If not, you could try using: del input, output, filter
>  That should release all remaining references to the output file, I presume.
> Or locate the inner reference to the output file (filter.something perhaps?)
> and explicitely close it.

That doesn't help either.
When I've rewrite code something like that:

       with open(backup_file_name, 'w') as backup_file:
               .....
               filter.parse('<updated file name>')
               del input, output, filter
        os.remove(project.get_vcproj())
        os.rename(backup_file_name, project.get_vcproj())

It triggers WindowsError on os.remove()
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to