Patches item #1748960, was opened at 2007-07-06 12:06 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1748960&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Modules Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Geoffrey Bache (gjb1002) Assigned to: Nobody/Anonymous (nobody) Summary: Extra optional argument to os.path.expandvars Initial Comment: I've several times wanted to expand a string in the way that os.path.expandvars does, but without modifying the actual environment. If for example I have inputString = "$ROOT/${SUBDIR}/some/path" and I want to find expanded versions of this, I have to do something like os.environ["ROOT"] = "/users/geoff" os.environ["SUBDIR"] = "subdir" fullPath = os.path.expandvars(inputString) The problem is that my program is multithreaded and I don't want to globally change os.environ. All I want is the information "fullPath". I'd like to be able to create a local "env" dictionary and pass it to os.path.expandvars as an optional second argument. I attach a patch for posixpath.py and ntpath.py, though this is untested and is intended to show what I mean in practice. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1748960&group_id=5470 _______________________________________________ Patches mailing list Patches@python.org http://mail.python.org/mailman/listinfo/patches