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:
Georg Brandl 2007-03-13 22:07:36 +00:00
parent b6ae6aa8ac
commit 03b90d8cfd
4 changed files with 64 additions and 22 deletions

View file

@ -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)