A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-September/048547.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.rmtreeJosiah Carlson jcarlson at uci.edu
Thu Sep 2 18:59:19 CEST 2004
> 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...


Only for this test.

In the general case, there could be other reasons why that deletion
failed.  One that I run into relatively often is...

Shell 1:
curpath: <drive>:\arbitrary\path\name

Shell 2:
curpath: <drive>:\arbitrary\path
command: python -c 'import os;os.remove("name")'

In this case, the OSError is the correct thing, and shouldn't be hidden
with a 'sleep'.


 - Josiah

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