[Python-checkins] cpython (3.3): #17809: fix a test failure in test_expanduser when $HOME has a trailing /.
ezio.melotti
python-checkins at python.org
Thu May 9 14:25:25 CEST 2013
http://hg.python.org/cpython/rev/dee0a2dea11e
changeset: 83695:dee0a2dea11e
branch: 3.3
parent: 83693:9ed127d8ad61
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Thu May 09 15:19:45 2013 +0300
summary:
#17809: fix a test failure in test_expanduser when $HOME has a trailing /. Patch by Kubilay Kocak.
files:
Lib/test/test_posixpath.py | 3 ++-
Misc/ACKS | 1 +
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -318,7 +318,8 @@
# expanduser should fall back to using the password database
del env['HOME']
home = pwd.getpwuid(os.getuid()).pw_dir
- self.assertEqual(posixpath.expanduser("~"), home)
+ # $HOME can end with a trailing /, so strip it (see #17809)
+ self.assertEqual(posixpath.expanduser("~"), home.rstrip("/"))
def test_normpath(self):
self.assertEqual(posixpath.normpath(""), ".")
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -648,6 +648,7 @@
Lenny Kneler
Pat Knight
Jeff Knupp
+Kubilay Kocak
Greg Kochanski
Damon Kohler
Marko Kohtala
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list