Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'argument': 0.05; 'subject:skip:s 10': 0.07; 'tune': 0.09; '(assuming': 0.16; '1.7': 0.16; 'docs.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'seconds,': 0.16; 'seconds.': 0.16; 'sleep(delay)': 0.16; 'subject:issue': 0.16; 'subject:timing': 0.16; 'wrote:': 0.18; 'skip:1 30': 0.19; 'hours,': 0.24; 'required.': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; "doesn't": 0.30; 'errors': 0.30; 'message-id:@mail.gmail.com': 0.30; '+0100,': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'checking': 0.33; 'received:google.com': 0.35; 'minimum': 0.38; 'skip:o 20': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'break': 0.61; 'maximum': 0.63; '30,': 0.65; 'minutes': 0.67; 'jul': 0.74; 'actually,': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=vVvzbs0kVV2W5MZqHD/RCuZvbRcTNA7D9jRm3TCJBcg=; b=VpViriybXVWoGwmlvqiMP7E7/v1B6ZFk3I0QmA6kQN705447rcyYP6/L7StWoC7Ns1 g+y6DS+bwSVhKJDH7M3ZOcujAgU5rjg8hGxaHuAmGrY5eKrZA3RCdT1LHK1eDm3S0/3V WYcK2hD4vAmyRDngKJBxg0L6vBoZAB5NKagCODc3XzT3asoTiqbUxRkqUIn8gbuZox7b eGq3T9aNZuhb9fh49ER0UpS1uwe5E05gQxhoR/WMJLxftQfEOrXXqT9AVdfEjPa+D+xP zh69vzaEZSvxZ4nHsPFrZrfRl26DtClFhhfDBWIJ3B3WbUuVVO0KNZVqKwczP3fKoTGG PAHw== MIME-Version: 1.0 X-Received: by 10.220.182.193 with SMTP id cd1mr10306860vcb.32.1375195666649; Tue, 30 Jul 2013 07:47:46 -0700 (PDT) In-Reply-To: <51f7c89a$0$30000$c3e8da3$5496439d@news.astraweb.com> References: <51f7c89a$0$30000$c3e8da3$5496439d@news.astraweb.com> Date: Tue, 30 Jul 2013 15:47:46 +0100 Subject: Re: timing issue: shutil.rmtree and os.makedirs From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375195670 news.xs4all.nl 15931 [2001:888:2000:d::a6]:55872 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51564 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,10000: >> 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 1.7 > minutes (assuming the directory doesn't get deleted instantaneously). > > time.sleep() takes an argument in seconds. LOL! Whoops. That's what I get for not checking my docs. This is why we have public responses, my errors can be caught by someone else. ChrisA