From: Georg Brandl Date: Sat, 30 Sep 2006 09:13:25 +0000 (+0000) Subject: Bug #1566602: correct failure of posixpath unittest when $HOME ends X-Git-Tag: v2.4.4c1~86 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=86b66b986492566cdd9a82b22e41a44446b38869;p=thirdparty%2FPython%2Fcpython.git Bug #1566602: correct failure of posixpath unittest when $HOME ends with a slash. (backport from rev. 52065) --- diff --git a/Lib/posixpath.py b/Lib/posixpath.py index 9eac6bc13ebc..b396f0ace5ec 100644 --- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -328,8 +328,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 284825e352f1..07be792bf28e 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -119,6 +119,9 @@ Extension Modules Library ------- +- Bug #1566602: correct failure of posixpath unittest when $HOME ends + with a slash. + - Reverted patch #1504333 because it introduced an infinite loop. - Fix missing import of the types module in logging.config.