Skip to content

Commit 5c0d462

Browse files
anderskserhiy-storchaka
authored andcommitted
bpo-32601: Let test_expanduser use the same user if no others found. (GH-5246)
This happens in the NixOS build sandbox, for example, where the only other user is nobody with home directory /.
1 parent 5cd22cf commit 5c0d462

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_pathlib.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,6 +2142,9 @@ def test_expanduser(self):
21422142
otherhome = pwdent.pw_dir.rstrip('/')
21432143
if othername != username and otherhome:
21442144
break
2145+
else:
2146+
othername = username
2147+
otherhome = userhome
21452148

21462149
p1 = P('~/Documents')
21472150
p2 = P('~' + username + '/Documents')

0 commit comments

Comments
 (0)