Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#236 closed defect (fixed)

Bitten slave can't remove svn checkout directory on Windows

Reported by: J. Kyllo <jkyllo-trac@…> Owned by: cmlenz
Priority: minor Milestone:
Component: Build slave Version: dev
Keywords: Cc: jkyllo-trac@…
Operating System: Windows

Description

On windows, the contents of the .svn directories are read-only. Although as a user, I can delete these files forcibly, the shutil.rmtree function simply fails with an OSError of "permission denied". Manually changing one of these files to remove the read-only flag allowed rmtree to remove that file. One possible solution to this is to give shutil.rmtree an error handler that, on a permission denied OSError, will retry the removal after using os.chmod() to clear the read-only flag for the file in question. Something along these lines:

def errfunc(func, path, excinfo):

e = excinfo[1] if e.errno == 13:

if e.filename:

import stat os.chmod(path, stat.S_IWRITE) func(e.filename)

else:

raise

else:

raise

shutil.rmtree(basedir, False, errfunc)

That seems a little hacky but hopefully it gets the idea across.

Attachments (0)

Change History (3)

comment:1 Changed 16 years ago by bitten@…

Appears to be duplicate of #211, which has a patch to fix the problem.

comment:2 Changed 16 years ago by J. Kyllo <jkyllo-trac@…>

I believe that is correct and this ticket can likely be closed. Thank you.

comment:3 Changed 16 years ago by wbell

  • Resolution set to fixed
  • Status changed from new to closed

Closed via [521]

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain cmlenz.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.