Bad docs for os.path.isabs()

Peter Hansen peter at engcorp.com
Sun Nov 9 16:44:16 EST 2003


Ben Allfree 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).

As Bengt says, that revision is still insufficient/incorrect.

Probably the only way it can really be said is something like 
"returns True if os.path.abspath() would leave the path unchanged".  
(Or some variation on that... i.e. leave the actual specification
to the nuts-and-bolts of the platform-dependent code, rather than
trying to rewrite it in English and risk duplication/errors.)

-Peter




More information about the Python-list mailing list