os.remove & os.rmdir

Padraig Brady padraig.brady at corvil.com
Thu Jan 9 11:08:52 CET 2003

Tim Roberts wrote:
> Padraig Brady <padraig.brady at corvil.com> wrote:
>>Peter Hansen wrote:
>>>Padraig Brady wrote:
>>>>So, should I do a simple patch?
>>>Please don't!
>>>>Advantages I can see are:
>>>>   1. It follows the standard
>>>Which standard?  This is Python, not C.
>>POSIX and ISO C. Having different functionality than those
>>is confusing I think.
> ISO C does not say this.  The spec only says that "remove" deletes a file.
> In response to a request for interpretation, the behavior when a directory
> name is given was officially deemed "unspecified".

Hmm, so POSIX is doing the specifying here?

Trust M$ to be different.

So I guess that means we should explicitly do this in the os module:

   If os.path.isdir(path):


More information about the Python-list mailing list