Edgewall Software

Changes between Initial Version and Version 1 of Ticket #253


Ignore:
Timestamp:
Jul 2, 2009, 3:10:07 AM (15 years ago)
Author:
osimons
Comment:

This I've seen before... Subversion makes various files inside a working copy read-only, and shutil.rmtree on Windows won't remove read-only files, and hence directories will not be empty when expected to.

I've got some utility code for another project that wraps rmtree, and if OS is Windows it walks all files and turns off read-only before removing:

import shutil, os
def rmtree(path, *args, **kwargs):
    if os.name == 'nt':
        for (dirpath, dirnames, filenames) in os.walk(path):
            # Windows does not allow remove of read-only files
            for filename in filenames:
                os.chmod(os.path.join(dirpath, filename),
                            stat.S_IWRITE)
    shutil.rmtree(path, *args, **kwargs)

I'll see if I can make a patch to actually test this.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #253

    • Property Owner changed from cmlenz to osimons
  • Ticket #253 – Description

    initial v1  
     1{{{
    12Traceback (most recent call last):
    23  File "C:\Python25\Scripts\bitten-slave-script.py", line 8, in <module>
     
    3233WindowsError: [Error 145] The directory is not empty: 'c:\\docume~1\\deepdi~1\\l
    3334ocals~1\\temp\\bittenufirfj\\build_Qt4.2_6\\deploy\\.svn'
     35}}}