summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Kaseorg <andersk@mit.edu>2018-05-14 14:00:37 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-05-14 14:00:37 (GMT)
commit5c0d462689e1a69537eaeba6ab94e3ff3524fc31 (patch)
tree1ab9c35d48c766cdb161facf26cc4e2fd5dfb534
parent5cd22cf2097a6dd209999cf97858d54564a3be87 (diff)
downloadcpython-5c0d462689e1a69537eaeba6ab94e3ff3524fc31.zip
cpython-5c0d462689e1a69537eaeba6ab94e3ff3524fc31.tar.gz
cpython-5c0d462689e1a69537eaeba6ab94e3ff3524fc31.tar.bz2
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 /.
-rw-r--r--Lib/test/test_pathlib.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index 5321555..d1a3fba 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -2142,6 +2142,9 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
otherhome = pwdent.pw_dir.rstrip('/')
if othername != username and otherhome:
break
+ else:
+ othername = username
+ otherhome = userhome
p1 = P('~/Documents')
p2 = P('~' + username + '/Documents')