A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-September/048545.html below:

[Python-Dev] Re: Coernic Desktop Search versus shutil.rmtree

[Python-Dev] Re: Coernic Desktop Search versus shutil.rmtree [Python-Dev] Re: Coernic Desktop Search versus shutil.rmtreeFredrik Lundh fredrik at pythonware.com
Thu Sep 2 18:34:23 CEST 2004
Tim Peters wrote:

> This is a timing problem.  By the time I can click on the folder to
> delete it in Explorer, or by the time I can type "rmdir/s xx",
> Copernic is long done reindexing the files, so there's no problem
> nuking the directory then.  shutil.rmtree issues the rmdir at machine
> speed.

so a possible robustification would be to add

def _rmdir(path):
    try:
        os.rmdir(path):
    except IOError, v:
        if sys.platform == "win32" and (directory not empty):
            time.sleep(0.1)
            os.rmdir(path)
        else:
            raise

and use _rmdir instead of os.rmdir in _build_cmdtuple...

</F> 



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4