Re: Occasional OSError: [Errno 13] Permission denied on Windows

2006-01-12 Thread Alec Wysoker
Well, I found a solution to some of these problems. Perhaps this new solution, combined with the sleeping to allow virus-checker,file-indexer,etc. will fix the problem. I opened a file with shelve, and when adding a particular entry found it to be corrupt. On Windows, shelve uses bsddb.hashopen.

Re: Occasional OSError: [Errno 13] Permission denied on Windows

2006-01-07 Thread Alec Wysoker
I tried something not exactly like this, but in the same spirit. I don't generally have a list of files I want to delete - just one. I try to delete it and if I get errno 13 I sleep for a little while (0.2) and then try again. If the same problem then I add 1 sec to the sleep time and try again.

Re: Occasional OSError: [Errno 13] Permission denied on Windows

2006-01-07 Thread Alec Wysoker
> File attributes may be an issue to. Take look at the recipe at: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303343 > which ensures the file attributes are normal before you delete it. I don't think file attributes are an issue, because generally I can manually delete the file in

Re: Occasional OSError: [Errno 13] Permission denied on Windows

2006-01-05 Thread Patrick Maupin
Tim Peters wrote: > In that case, anything that burns some time and tries again > will work better. Replacing gc.collect() with time.sleep() is > an easy way to test that hypothesis; because gc.collect() > does an all-generations collection, it can consume measurable time. An slight enhancemen

Re: Occasional OSError: [Errno 13] Permission denied on Windows

2006-01-05 Thread pyguy2
File attributes may be an issue to. Take look at the recipe at: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303343 which ensures the file attributes are normal before you delete it. john -- http://mail.python.org/mailman/listinfo/python-list

Re: Occasional OSError: [Errno 13] Permission denied on Windows

2006-01-05 Thread Ernst Noch
Alec Wysoker wrote: >>>Using Python 2.3.5 on Windows XP, I occasionally get OSError: [Errno >>>13] Permission denied when calling os.remove(). This can occur with a >>>file that is not used by any other process on the machine, >> >>How do you know that? > > > Yeah, good point. I don't really kn

Re: Occasional OSError: [Errno 13] Permission denied on Windows

2006-01-05 Thread Grant Edwards
On 2006-01-05, Alec Wysoker <[EMAIL PROTECTED]> wrote: >>> Using Python 2.3.5 on Windows XP, I occasionally get OSError: [Errno >>> 13] Permission denied when calling os.remove(). This can occur with a >>> file that is not used by any other process on the machine, >> >> How do you know that? > > Y

Re: Occasional OSError: [Errno 13] Permission denied on Windows

2006-01-05 Thread Alec Wysoker
>> Using Python 2.3.5 on Windows XP, I occasionally get OSError: [Errno >> 13] Permission denied when calling os.remove(). This can occur with a >> file that is not used by any other process on the machine, > > How do you know that? Yeah, good point. I don't really know. I should have said no p

Re: Occasional OSError: [Errno 13] Permission denied on Windows

2006-01-05 Thread Alec Wysoker
Interesting theory. I do have a virus scanner, and also Google Desktop Search. Sometimes I get this error when running a large suite of unit tests. Each unit test starts off by cleaning the test output directory, and failing if it can't do so. I will see many (hundreds?) tests fail because the

Re: Occasional OSError: [Errno 13] Permission denied on Windows

2006-01-05 Thread Patrick Maupin
Alec Wysoker wrote: > Using Python 2.3.5 on Windows XP, I occasionally get OSError: > [Errno 13] Permission denied when calling os.remove(). This can > occur with a file that is not used by any other process on the > machine, and is created by the python.exe invocation that is > trying to delete

Re: Occasional OSError: [Errno 13] Permission denied on Windows

2006-01-05 Thread Tim Peters
[Alec Wysoker] > Using Python 2.3.5 on Windows XP, I occasionally get OSError: [Errno > 13] Permission denied when calling os.remove(). This can occur with a > file that is not used by any other process on the machine, How do you know that? > and is created by the python.exe invocation that is t