os.readlink recipe for getting an absolute path
July 9, 2010
12:36 p.m.
Hello, In the doc of os.readlink [1], it is stated: "Return a string representing the path to which the symbolic link points. The result may be either an absolute or relative pathname; if it is relative, it may be converted to an absolute pathname using os.path.join(os.path.dirname(path), result)." However, if `path` is relative, the result of this command will be relative, which makes the documentation inaccurate. The wording should be changed or the command updated to something like: os.path.join(os.path.abspath(os.path.dirname(path)), result) [1] http://docs.python.org/library/os.html#os.readlink Cheers, and many thanks for the wonderful documentation Sebastien
5760
Age (days ago)
5760
Last active (days ago)
0 comments
1 participants
participants (1)
-
Sébastien Barthélemy