mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
gh-117503: Fix test for posixpath.expanduser() when pw_dir ends with / (GH-118056)
This commit is contained in:
parent
94444ea45a
commit
ccdcd1d95a
1 changed files with 1 additions and 0 deletions
|
@ -351,6 +351,7 @@ class PosixPathTest(unittest.TestCase):
|
||||||
for e in pwd.getpwall():
|
for e in pwd.getpwall():
|
||||||
name = e.pw_name
|
name = e.pw_name
|
||||||
home = e.pw_dir
|
home = e.pw_dir
|
||||||
|
home = home.rstrip('/') or '/'
|
||||||
self.assertEqual(posixpath.expanduser('~' + name), home)
|
self.assertEqual(posixpath.expanduser('~' + name), home)
|
||||||
self.assertEqual(posixpath.expanduser(os.fsencode('~' + name)),
|
self.assertEqual(posixpath.expanduser(os.fsencode('~' + name)),
|
||||||
os.fsencode(home))
|
os.fsencode(home))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue