@@ -262,20 +262,21 @@ def test_expanduser(self):
262262 env ['USERPROFILE' ] = 'C:\\ eric\\ idle'
263263 tester ('ntpath.expanduser("~test")' , 'C:\\ eric\\ test' )
264264 tester ('ntpath.expanduser("~")' , 'C:\\ eric\\ idle' )
265-
266- env .clear ()
267- env ['HOME' ] = 'C:\\ idle\\ eric'
268- tester ('ntpath.expanduser("~test")' , 'C:\\ idle\\ test' )
269- tester ('ntpath.expanduser("~")' , 'C:\\ idle\\ eric' )
270-
271265 tester ('ntpath.expanduser("~test\\ foo\\ bar")' ,
272- 'C:\\ idle \\ test\\ foo\\ bar' )
266+ 'C:\\ eric \\ test\\ foo\\ bar' )
273267 tester ('ntpath.expanduser("~test/foo/bar")' ,
274- 'C:\\ idle \\ test/foo/bar' )
268+ 'C:\\ eric \\ test/foo/bar' )
275269 tester ('ntpath.expanduser("~\\ foo\\ bar")' ,
276- 'C:\\ idle \\ eric \\ foo\\ bar' )
270+ 'C:\\ eric \\ idle \\ foo\\ bar' )
277271 tester ('ntpath.expanduser("~/foo/bar")' ,
278- 'C:\\ idle\\ eric/foo/bar' )
272+ 'C:\\ eric\\ idle/foo/bar' )
273+
274+ # bpo-36264: ignore `HOME` when set on windows
275+ env .clear ()
276+ env ['HOME' ] = 'F:\\ '
277+ env ['USERPROFILE' ] = 'C:\\ eric\\ idle'
278+ tester ('ntpath.expanduser("~test")' , 'C:\\ eric\\ test' )
279+ tester ('ntpath.expanduser("~")' , 'C:\\ eric\\ idle' )
279280
280281 @unittest .skipUnless (nt , "abspath requires 'nt' module" )
281282 def test_abspath (self ):
0 commit comments