From: Georg Brandl Date: Sat, 30 Sep 2006 09:13:21 +0000 (+0000) Subject: Bug #1566602: correct failure of posixpath unittest when $HOME ends X-Git-Tag: v2.6a1~2624 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8d1e5bffc1249cdb5a8ced25e6f89328e7366290;p=thirdparty%2FPython%2Fcpython.git Bug #1566602: correct failure of posixpath unittest when $HOME ends with a slash. --- diff --git a/Lib/posixpath.py b/Lib/posixpath.py index 9dd0e9079d01..07ab4b672c78 100644 --- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -259,8 +259,7 @@ def expanduser(path): except KeyError: return path userhome = pwent.pw_dir - if userhome.endswith('/'): - i += 1 + userhome = userhome.rstrip('/') return userhome + path[i:] diff --git a/Misc/NEWS b/Misc/NEWS index 4acce5c4e65e..6d048cc13798 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -63,6 +63,9 @@ Core and builtins Library ------- +- Bug #1566602: correct failure of posixpath unittest when $HOME ends + with a slash. + - Bug #1565661: in webbrowser, split() the command for the default GNOME browser in case it is a command with args.