Skip to content

Commit be1fe11

Browse files
[3.12] gh-117503: Fix test for posixpath.expanduser() when pw_dir ends with / (GH-118056) (GH-118058)
(cherry picked from commit ccdcd1d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent dd8b4d4 commit be1fe11

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Lib/test/test_posixpath.py

+1
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ def test_expanduser_pwd2(self):
341341
for e in pwd.getpwall():
342342
name = e.pw_name
343343
home = e.pw_dir
344+
home = home.rstrip('/') or '/'
344345
self.assertEqual(posixpath.expanduser('~' + name), home)
345346
self.assertEqual(posixpath.expanduser(os.fsencode('~' + name)),
346347
os.fsencode(home))

0 commit comments

Comments
 (0)