]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-117503: Fix test for posixpath.expanduser() when pw_dir ends with / (GH-118056)
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 18 Apr 2024 16:59:52 +0000 (19:59 +0300)
committerGitHub <noreply@github.com>
Thu, 18 Apr 2024 16:59:52 +0000 (16:59 +0000)
Lib/test/test_posixpath.py

index 604af5bafa7f1367ac1d31bb526b4f7122ace8a8..32a20efbb64e1d14e10973a8fbcc70fedee19e52 100644 (file)
@@ -351,6 +351,7 @@ class PosixPathTest(unittest.TestCase):
         for e in pwd.getpwall():
             name = e.pw_name
             home = e.pw_dir
+            home = home.rstrip('/') or '/'
             self.assertEqual(posixpath.expanduser('~' + name), home)
             self.assertEqual(posixpath.expanduser(os.fsencode('~' + name)),
                              os.fsencode(home))