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

This commit is contained in:
Serhiy Storchaka 2024-04-18 19:59:52 +03:00 committed by GitHub
parent 94444ea45a
commit ccdcd1d95a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View 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))