Bad docs for os.path.isabs()

Bengt Richter bokr at oz.net
Sun Nov 9 15:20:34 EST 2003


On Sun, 9 Nov 2003 11:32:46 -0800, "Ben Allfree" <benles at bldigital.com> wrote:

>The docs for os.path.isabs() state:
>
>      isabs( path)
>
>Return True if path is an absolute pathname (begins with a slash).
>
>This is false becase os.path.isabs("C:\\foo") == True
>
>It should read:
>
>      isabs( path)
>
>Return True if path is an absolute pathname (begins with a slash or drive
>letter).

While you're at it, better take this into account also ;-)

 >>> import os
 >>> os.path.isabs("C:\\foo")
 True
 >>> os.path.isabs("C:foo")
 False
 >>> os.path.isabs("\\foo")
 True

For that last one, I think you could argue that it's false, since it does not
absolutely specify what the meaning is in a multi-drive system.

The whole drive letter file path thing is soo lame it makes me incoherent ;-/

Regards,
Bengt Richter




More information about the Python-list mailing list