[3.12] gh-117503: Fix test for posixpath.expanduser() when pw_dir ends with / (GH-118056) (GH-118058)

(cherry picked from commit ccdcd1d95a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-04-18 19:17:05 +02:00 committed by GitHub
parent dd8b4d4d37
commit be1fe1149f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -341,6 +341,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))