mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Patch #957650: "%var%" environment variable references are now properly
expanded in ntpath.expandvars(), also "~user" home directory references are recognized and handled on Windows.
This commit is contained in:
parent
b6ae6aa8ac
commit
03b90d8cfd
4 changed files with 64 additions and 22 deletions
|
@ -134,6 +134,13 @@ try:
|
|||
tester('ntpath.expandvars("${{foo}}")', "baz1}")
|
||||
tester('ntpath.expandvars("$foo$foo")', "barbar")
|
||||
tester('ntpath.expandvars("$bar$bar")', "$bar$bar")
|
||||
tester('ntpath.expandvars("%foo% bar")', "bar bar")
|
||||
tester('ntpath.expandvars("%foo%bar")', "barbar")
|
||||
tester('ntpath.expandvars("%foo%%foo%")', "barbar")
|
||||
tester('ntpath.expandvars("%%foo%%foo%foo%")', "%foo%foobar")
|
||||
tester('ntpath.expandvars("%?bar%")', "%?bar%")
|
||||
tester('ntpath.expandvars("%foo%%bar")', "bar%bar")
|
||||
tester('ntpath.expandvars("\'%foo%\'%bar")', "\'%foo%\'%bar")
|
||||
finally:
|
||||
os.environ.clear()
|
||||
os.environ.update(oldenv)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue