os.path.realpath() and os.path.abspath()

Adam Skutt askutt at gmail.com
Tue Jan 11 22:30:43 EST 2011


On Jan 11, 6:35 am, Jurko Gospodnetić <jurko.gospodne... at pke.hr>
wrote:
>    Hi all.
>
>    os.path.realpath() documentation states that it returns a 'canonical'
> path. Does that infer that it returns an absolute path?
>

A canonical path is supposed to be absolute and at least Python 2.7.1
ensures that is the case.

Historically, some versions of the UNIX syscall (Solaris in
particular) have not always returned absolute paths, but I believe
this is no longer the case and was a very long standing bug (though I
may be mistaken).

Adam



More information about the Python-list mailing list