Commit ce82d57c authored by Ezio Melotti's avatar Ezio Melotti

#17809: fix a test failure in test_expanduser when $HOME has a trailing /. Patch by Kubilay Kocak.

parent 263fab94
...@@ -318,7 +318,8 @@ class PosixPathTest(unittest.TestCase): ...@@ -318,7 +318,8 @@ class PosixPathTest(unittest.TestCase):
# expanduser should fall back to using the password database # expanduser should fall back to using the password database
del env['HOME'] del env['HOME']
home = pwd.getpwuid(os.getuid()).pw_dir 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): def test_normpath(self):
self.assertEqual(posixpath.normpath(""), ".") self.assertEqual(posixpath.normpath(""), ".")
......
...@@ -648,6 +648,7 @@ Kim Knapp ...@@ -648,6 +648,7 @@ Kim Knapp
Lenny Kneler Lenny Kneler
Pat Knight Pat Knight
Jeff Knupp Jeff Knupp
Kubilay Kocak
Greg Kochanski Greg Kochanski
Damon Kohler Damon Kohler
Marko Kohtala Marko Kohtala
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment