summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pathlib.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-03 18:17:03 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-03 18:17:03 (GMT)
commita3fd0b26ba7d302475e051b698c86f512d0e7a14 (patch)
tree182105d3ba29f726e1aa0f41f2c40382ffdc7243 /Lib/test/test_pathlib.py
parent929d7f86d50b21ac10ad7fea73d3b9c4cf63b18a (diff)
downloadcpython-a3fd0b26ba7d302475e051b698c86f512d0e7a14.zip
cpython-a3fd0b26ba7d302475e051b698c86f512d0e7a14.tar.gz
cpython-a3fd0b26ba7d302475e051b698c86f512d0e7a14.tar.bz2
Issue #24950: Fixed expanduser tests when the users home directory in pwd is "/".
Based on patch by SilentGhost.
Diffstat (limited to 'Lib/test/test_pathlib.py')
-rw-r--r--Lib/test/test_pathlib.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index 247a6b3..0ea4aef 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -2062,7 +2062,7 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
import pwd
pwdent = pwd.getpwuid(os.getuid())
username = pwdent.pw_name
- userhome = pwdent.pw_dir.rstrip('/')
+ userhome = pwdent.pw_dir.rstrip('/') or '/'
# find arbitrary different user (if exists)
for pwdent in pwd.getpwall():
othername = pwdent.pw_name