summaryrefslogtreecommitdiff
path: root/Lib/test/test_posixpath.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-05-09 15:19:45 +0300
committerEzio Melotti <ezio.melotti@gmail.com>2013-05-09 15:19:45 +0300
commitcf983ec274e3a7ac6143eb7e9ccdf6ae28250092 (patch)
treee445141795a22f2917b9af1443ccf57f5950be5e /Lib/test/test_posixpath.py
parent9dd95d0308422cf851e6343f7f60a31c508d33c3 (diff)
downloadcpython-cf983ec274e3a7ac6143eb7e9ccdf6ae28250092.tar.gz
#17809: fix a test failure in test_expanduser when $HOME has a trailing /. Patch by Kubilay Kocak.
Diffstat (limited to 'Lib/test/test_posixpath.py')
-rw-r--r--Lib/test/test_posixpath.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
index 724c530261..0e7d866485 100644
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -318,7 +318,8 @@ class PosixPathTest(unittest.TestCase):
# expanduser should fall back to using the password database
del env['HOME']
home = pwd.getpwuid(os.getuid()).pw_dir
- self.assertEqual(posixpath.expanduser("~"), home)
+ # $HOME can end with a trailing /, so strip it (see #17809)
+ self.assertEqual(posixpath.expanduser("~"), home.rstrip("/"))
def test_normpath(self):
self.assertEqual(posixpath.normpath(""), ".")