mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
[3.12] gh-117503: Fix test for posixpath.expanduser() when pw_dir ends with / (GH-118056) (GH-118058)
(cherry picked from commit ccdcd1d95a
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
dd8b4d4d37
commit
be1fe1149f
1 changed files with 1 additions and 0 deletions
|
@ -341,6 +341,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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue