From 8b1003f215707a7e2caf067a115e398a59a8d599 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 18 Apr 2024 19:25:26 +0300 Subject: [PATCH] gh-117503: Fix test for posixpath.expanduser() when pw_dir ends with / --- Lib/test/test_posixpath.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py index 604af5bafa7f13..32a20efbb64e1d 100644 --- a/Lib/test/test_posixpath.py +++ b/Lib/test/test_posixpath.py @@ -351,6 +351,7 @@ def test_expanduser_pwd2(self): 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))