From ccdcd1d95a9d6eda4df86811c4539f204beef817 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 18 Apr 2024 19:59:52 +0300 Subject: [PATCH] gh-117503: Fix test for posixpath.expanduser() when pw_dir ends with / (GH-118056) --- 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 604af5bafa7..32a20efbb64 100644 --- a/Lib/test/test_posixpath.py +++ b/Lib/test/test_posixpath.py @@ -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))