Re: file locked for writing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dmitry Teslenko

    Re: file locked for writing

    On Wed, May 14, 2008 at 8:18 AM, Gabriel Genellina
    <gagsl-py2@yahoo.com.a rwrote:
    En Tue, 13 May 2008 11:57:03 -0300, Dmitry Teslenko <dteslenko@gmai l.com>
    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.somethi ng perhaps?)
    and explicitely close it.
    That doesn't help either.
    When I've rewrite code something like that:

    with open(backup_fil e_name, 'w') as backup_file:
    .....
    filter.parse('< updated file name>')
    del input, output, filter
    os.remove(proje ct.get_vcproj() )
    os.rename(backu p_file_name, project.get_vcp roj())

    It triggers WindowsError on os.remove()
Working...