]> granicus.if.org Git - python/commitdiff
#17809: fix a test failure in test_expanduser when $HOME has a trailing /. Patch...
authorEzio Melotti <ezio.melotti@gmail.com>
Thu, 9 May 2013 12:19:45 +0000 (15:19 +0300)
committerEzio Melotti <ezio.melotti@gmail.com>
Thu, 9 May 2013 12:19:45 +0000 (15:19 +0300)
Lib/test/test_posixpath.py
Misc/ACKS

index 724c53026123244057bf876445f260d5685010eb..0e7d86648582efc1a12d6e35157fd5c503add857 100644 (file)
@@ -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(""), ".")
index ed30056c6a066e355a839dafe2d8a52e01513625..90913acb65e87844f581161bbafd889479b16b05 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -648,6 +648,7 @@ Kim Knapp
 Lenny Kneler
 Pat Knight
 Jeff Knupp
+Kubilay Kocak
 Greg Kochanski
 Damon Kohler
 Marko Kohtala