Bad docs for os.path.isabs()
Georgy Pruss
SEE_AT_THE_END at hotmail.com
Sun Nov 9 22:01:12 EST 2003
"Bengt Richter" <bokr at oz.net> wrote in message news:bom7ii$8n4$0 at 216.39.172.122...
> 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).
Return True if path is an absolute pathname i.e. it begins with a slash or backslash,
possibly prepended by a drive letter and a colon.
... or something like that.
Sorry for my bad English.
G-:
--
Georgy Pruss
E^mail: 'ZDAwMTEyMHQwMzMwQGhvdG1haWwuY29t\n'.decode('base64')
>
> 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