I would like to add an optional second argument to os.path.abspath() to allow specifying the directory with respect to which the path should be made absolute. This would be much like the optional second argument of the expand-file-name function in emacs: (expand-file-name NAME &optional DEFAULT-DIRECTORY) The patch is against python 2.2.2. I am running RH 6.3 linux but that should not matter. thanks Greg Klanderman gak@klanderman.net
Logged In: YES user_id=698972 i can submit a patch for those other versions of abspath. but i'd rather know whether there is support for this change before doing that.
Logged In: YES user_id=469548 Well, depends on what you mean by 'support'. I don't think anyone seriously objects, but there doesn't seem to be anyone who really cares either. That usually means that if you care enough to create a complete implementation (including tests and documentation changes) yourself, the patch will be accepted. So please submit a new patch if you do care enough.
Well, it's been 4 years and I'd pretty much forgotten about this.. but I believe I had a case where my program had some configuration item - the base directory w.r.t. which other files were to be found. So if you have one of those file names, it's convenient to use abspath() except you don't want it relative to the process' cwd, you want it relative to the configured directory. Anyway, it's no big deal, you can just close this if you want.