diff options
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/ntpath.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_ntpath.py | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py index af3fb8746a..992970ab1d 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -400,7 +400,7 @@ def expandvars(path): index = path.index(c) res += c + path[:index + 1] except ValueError: - res += path + res += c + path index = pathlen - 1 elif c == percent: # variable or '%' if path[index + 1:index + 2] == percent: diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index c8d84a7467..dacddded3d 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -237,6 +237,7 @@ class TestNtpath(unittest.TestCase): tester('ntpath.expandvars("%?bar%")', "%?bar%") tester('ntpath.expandvars("%foo%%bar")', "bar%bar") tester('ntpath.expandvars("\'%foo%\'%bar")', "\'%foo%\'%bar") + tester('ntpath.expandvars("bar\'%foo%")', "bar\'%foo%") @unittest.skipUnless(support.FS_NONASCII, 'need support.FS_NONASCII') def test_expandvars_nonascii(self): |
