Mailing List Archive

gh-117503: Fix test for posixpath.expanduser() when pw_dir ends with / (GH-118056)
https://github.com/python/cpython/commit/ccdcd1d95a9d6eda4df86811c4539f204beef817
commit: ccdcd1d95a9d6eda4df86811c4539f204beef817
branch: main
author: Serhiy Storchaka <storchaka@gmail.com>
committer: serhiy-storchaka <storchaka@gmail.com>
date: 2024-04-18T16:59:52Z
summary:

gh-117503: Fix test for posixpath.expanduser() when pw_dir ends with / (GH-118056)

files:
M Lib/test/test_posixpath.py

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))

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-leave@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: list-python-checkins@lists.gossamer-threads.com