Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Göktuğ Kayaalp
On Jul 30, 2013 3:29 PM, "Chris Angelico" wrote: > > On Tue, Jul 30, 2013 at 2:10 PM, Tim wrote: > > hmm, now that you mention it, this is executing on a remote box with access to the same file system my local calling program is on. That is, there is a local call to an intermediate script that co

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Chris Angelico
On Tue, Jul 30, 2013 at 4:37 PM, Tim wrote: > Argg, this isn't the first time I've had troubles with the file system. This > is FreeBSD and NFS. I will code up a progressive delay as you mentioned (with > Steve's correction). I've used several different networked file systems, including NetBIOS

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Tim
On Tuesday, July 30, 2013 9:27:10 AM UTC-4, Chris Angelico wrote: > On Tue, Jul 30, 2013 at 2:10 PM, Tim wrote: > > hmm, now that you mention it, this is executing on a remote box with access > > to the same file system my local calling program is on. That is, there is a > > local call to an inte

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Chris Angelico
On Tue, Jul 30, 2013 at 3:07 PM, Steven D'Aprano wrote: > On Tue, 30 Jul 2013 14:27:10 +0100, Chris Angelico wrote: > >> for delay in 100,300,600,1000,3000,5000,1: >> if not os.path.exists(directory): break >> sleep(delay) >> >> That'll sleep a maximum of 20 seconds, tune as required. > >

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Steven D'Aprano
On Tue, 30 Jul 2013 14:27:10 +0100, Chris Angelico wrote: > for delay in 100,300,600,1000,3000,5000,1: > if not os.path.exists(directory): break > sleep(delay) > > That'll sleep a maximum of 20 seconds, tune as required. Actually, that will sleep a maximum of 5.55 hours, and a minimum of

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Chris Angelico
On Tue, Jul 30, 2013 at 2:10 PM, Tim wrote: > hmm, now that you mention it, this is executing on a remote box with access > to the same file system my local calling program is on. That is, there is a > local call to an intermediate script that connects to a socket on the remote > where the abov

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-30 Thread Tim
On Monday, July 29, 2013 7:52:36 PM UTC-4, Chris Angelico wrote: > On Mon, Jul 29, 2013 at 8:16 PM, Tim wrote: > > My intent is to pass it a directory name or path and if it exists, use > > shutil.rmtree to remove whatever is there (if it isn't a directory, try to > > unlink it); then use os.make

Re: timing issue: shutil.rmtree and os.makedirs

2013-07-29 Thread Chris Angelico
On Mon, Jul 29, 2013 at 8:16 PM, Tim wrote: > My intent is to pass it a directory name or path and if it exists, use > shutil.rmtree to remove whatever is there (if it isn't a directory, try to > unlink it); then use os.makedirs to create a new directory or path: > > def make_clean_dir(directory

timing issue: shutil.rmtree and os.makedirs

2013-07-29 Thread Tim
I have the following function (Python2.7 on FreeBSD) that results in an OSError. My intent is to pass it a directory name or path and if it exists, use shutil.rmtree to remove whatever is there (if it isn't a directory, try to unlink it); then use os.makedirs to create a new directory or path: