Skip to content

Commit ccdcd1d

Browse files
gh-117503: Fix test for posixpath.expanduser() when pw_dir ends with / (GH-118056)
1 parent 94444ea commit ccdcd1d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Lib/test/test_posixpath.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ def test_expanduser_pwd2(self):
351351
for e in pwd.getpwall():
352352
name = e.pw_name
353353
home = e.pw_dir
354+
home = home.rstrip('/') or '/'
354355
self.assertEqual(posixpath.expanduser('~' + name), home)
355356
self.assertEqual(posixpath.expanduser(os.fsencode('~' + name)),
356357
os.fsencode(home))

0 commit comments

Comments
 (0)