diff -r 492eba054e59 Lib/test/test_posixpath.py --- a/Lib/test/test_posixpath.py Wed May 08 11:16:33 2013 +0300 +++ b/Lib/test/test_posixpath.py Wed May 08 18:35:49 2013 +1000 @@ -261,7 +261,8 @@ # 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(""), ".")