From: Benjamin R. <ben...@ou...> - 2011-01-06 19:25:22
|
On Thu, Jan 6, 2011 at 12:32 PM, John Hunter <jd...@gm...> wrote: > On Thu, Jan 6, 2011 at 12:22 PM, John Hunter <jd...@gm...> wrote: > > > 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. > > There is an exception to this -- if MATPLOTLIBRC or MPLCONFIGDIR are > relative paths, then matplotlib_fname will return a relative path too. > Ah, all the more reason to apply abspath() or realpath(). To decide which to use, let's consider the case of someone (like a developer) having multiple builds of matplotlib in separate directories, and uses a symlink to point to whichever he wants to use at the moment. The question is, in this use-case, would we want the symbolic link pathname, or the absolute pathname? I don't mess around with docs enough to know which I would want. I have attached a modified patch (which uses realpath(), but could easily be changed to abspath()). I also included some comments to more fully document what is going on and the rational for the logic being taken. Ben Root P.S. - Just to make sure, I noticed that rcParamsOrig is only in the maintenance branch. It was intended to leave the development branch "broken" for now until we get this working properly? |