Issue 1574252: Add %var% support to ntpath.expandvars (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/44107

classification

Title: Add %var% support to ntpath.expandvars
Type: Stage:
Components: Library (Lib) Versions:

process

Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: doubleyewdee, georg.brandl, josiahcarlson, loewis
Priority: normal Keywords: patch

Created on 2006-10-10 04:45 by doubleyewdee, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ntpath.patch doubleyewdee,2006-10-10 04:45
Messages (6)
msg51223 - (view) Author: Chip Norkus (doubleyewdee) Date: 2006-10-10 04:45
NT variables are passed around as %var% instead of varorvar or varor{var}. Providing support for this gives a seamless user experience for NT users using Python. E.g. os.path.expandvars('%TEMP%') now does what is expected on NT. I updated the docstring, could not find any tests or documentation references in svn for this portion of code.
msg51224 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2006-10-16 22:47
Logged In: YES user_id=341410 See also: http://python.org/sf/796219 and http://python.org/sf/957650
msg51225 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-10-22 14:36
Logged In: YES user_id=21627 josiahcarlson, can you propose a strategy to resolve this all?
msg51226 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2006-10-22 17:49
Logged In: YES user_id=341410 I believe that there are two changes that are desireable; the functionality offered in this patch (expansion of %VAR% environment variables), and ~user\subpath expansion. Recursive re-application of variable expansion shouldn't occur. I can merge the two patches that adds the functionality to ntpath.expanduser and ntpath.expandvars .
msg51227 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2006-10-22 21:28
Logged In: YES user_id=341410 I've added a new patch to http://python.org/sf/957650 that adds both the expanduser and expandvars case. The expandvars case is slightly different from what the OP submitted, if only in that it won't mask ValueErrors that don't come from the str.index() call.
msg51228 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-03-13 08:40
Closing in favor of #957650.
History
Date User Action Args
2022-04-11 14:56:20 admin set github: 44107
2006-10-10 04:45:53 doubleyewdee create