mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-36264: Don't honor POSIX HOME in os.path.expanduser on Windows (GH-12282)
This commit is contained in:
parent
410aea1ebf
commit
25ec4a45dc
6 changed files with 17 additions and 14 deletions
|
@ -262,20 +262,21 @@ class TestNtpath(unittest.TestCase):
|
|||
env['USERPROFILE'] = 'C:\\eric\\idle'
|
||||
tester('ntpath.expanduser("~test")', 'C:\\eric\\test')
|
||||
tester('ntpath.expanduser("~")', 'C:\\eric\\idle')
|
||||
|
||||
env.clear()
|
||||
env['HOME'] = 'C:\\idle\\eric'
|
||||
tester('ntpath.expanduser("~test")', 'C:\\idle\\test')
|
||||
tester('ntpath.expanduser("~")', 'C:\\idle\\eric')
|
||||
|
||||
tester('ntpath.expanduser("~test\\foo\\bar")',
|
||||
'C:\\idle\\test\\foo\\bar')
|
||||
'C:\\eric\\test\\foo\\bar')
|
||||
tester('ntpath.expanduser("~test/foo/bar")',
|
||||
'C:\\idle\\test/foo/bar')
|
||||
'C:\\eric\\test/foo/bar')
|
||||
tester('ntpath.expanduser("~\\foo\\bar")',
|
||||
'C:\\idle\\eric\\foo\\bar')
|
||||
'C:\\eric\\idle\\foo\\bar')
|
||||
tester('ntpath.expanduser("~/foo/bar")',
|
||||
'C:\\idle\\eric/foo/bar')
|
||||
'C:\\eric\\idle/foo/bar')
|
||||
|
||||
# bpo-36264: ignore `HOME` when set on windows
|
||||
env.clear()
|
||||
env['HOME'] = 'F:\\'
|
||||
env['USERPROFILE'] = 'C:\\eric\\idle'
|
||||
tester('ntpath.expanduser("~test")', 'C:\\eric\\test')
|
||||
tester('ntpath.expanduser("~")', 'C:\\eric\\idle')
|
||||
|
||||
@unittest.skipUnless(nt, "abspath requires 'nt' module")
|
||||
def test_abspath(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue