Closed Bug 498735 Opened 12 years ago Closed 12 years ago
rmtree doesn't remove read-only files on Windows
rmtree doesn't cope with read-only files on Windows, so do it ourselves.
Attachment #383541 - Flags: review?(bugzilla)
Assignee: nobody → sid.bugzilla
Status: NEW → ASSIGNED
I've been running with this patch for a while w/o problems, and when I accidentally unapplied it, things went south right away. So I think this is worth getting in so that we can run mozmill tests on windows...
I've been hesitant with getting round to this. This bit just makes me think twice: +# From pathutils <http://www.voidspace.org.uk/python/pathutils.html> +# by Michael Foord +# rmtreeing read-only files fails on Windows Looking at this again, that has a BSD license and this is test code only but with an MPL license header. I believe the two are compatible, but this makes me think twice. cc'ing gerv who I'm sure will have a better idea if it is ok just to copy/paste this code than me.
There's only six actual lines of code there, and it debatable how many different ways there are to do what you want, and therefore whether there's a copyright interest. The easiest thing to do would be to email the developer: firstname.lastname@example.org, and ask for permission to include it under the existing terms for the file. Gerv
You have my permission (in as much as you needed it in the first place...) to use, modify and relicense those 6 lines of code. :-) I'm on holiday at the moment and won't get a chance to look at the actual bug report for a few days. If the problem you are trying to solve is genuinely just removing read-only files on Windows with shutil.rmtree then the onerror handler should work fine for this purpose.
Thanks, Michael :-) Gerv
Comment on attachment 383541 [details] [diff] [review] patch >+# From pathutils <http://www.voidspace.org.uk/python/pathutils.html> >+# by Michael Foord >+# rmtreeing read-only files fails on Windows Based on Michael's comment, I think we can drop these lines and add Michael to the contributors list in the license header. Thanks Michael. r=Standard8.
Attachment #383541 - Flags: review?(bugzilla) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.