This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: add optional CWD argument to os.path.abspath()
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, collinwinter, gregklanderman, jlgijsbers
Priority: normal Keywords: patch

Created on 2003-01-31 01:23 by gregklanderman, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
os.path.patch gregklanderman, 2003-01-31 01:28 patch
Messages (8)
msg42616 - (view) Author: Greg Klanderman (gregklanderman) Date: 2003-01-31 01:23
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
msg42617 - (view) Author: Greg Klanderman (gregklanderman) Date: 2003-01-31 01:28
Logged In: YES 
user_id=698972

sorry, trying again to attach the patch..
msg42618 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-02-05 10:06
Logged In: YES 
user_id=357491

What about ntpath.py and os2emxpath.py?
msg42619 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-02-05 10:16
Logged In: YES 
user_id=357491

And don't forget riscospath.py found in the plat-risc directory in Lib in the source distribution.  =)
msg42620 - (view) Author: Greg Klanderman (gregklanderman) Date: 2003-02-05 18:09
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.

msg42621 - (view) Author: Johannes Gijsbers (jlgijsbers) * (Python triager) Date: 2004-08-21 12:55
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.
msg42622 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2007-03-12 00:49
What's your motivating use-case for this?
msg42623 - (view) Author: Greg Klanderman (gregklanderman) Date: 2007-03-12 04:31
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.
History
Date User Action Args
2022-04-10 16:06:20adminsetgithub: 37875
2003-01-31 01:23:08gregklandermancreate