From: John H. <jd...@gm...> - 2011-01-06 18:22:29
|
On Thu, Jan 6, 2011 at 12:15 PM, Benjamin Root <ben...@ou...> wrote: > A comment on the patch. Unless matplotlib_fname() is guaranteed to return > an absolute filename, then we need to use realpath() on _basedir so that the > final joined filename will also be absolute. The reason for using > realpath() instead of abspath() is that in case there are any symbolic links > in the name from matplotlib_fname(), these will be qualified so that the > filepath matplotlib sees is the same filepath that spinx sees. > > Also, a little oddity that I discovered in reading the docs for > os.path.join(), turns out that if any element is already an absolute path, > then it ignores all elements prior to that. In this patch, everything is ok > because we already check for isabs(). Just thought I ought to point that > out because I never knew that and that would certainly be a nasty bug to try > and track down.. matplotlib_fname() always returns absolute path. I have not used realpath, but if you think there is a use for it here, feel free to post an amended patch. JDH |