summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-09-30 09:13:25 +0000
committerGeorg Brandl <georg@python.org>2006-09-30 09:13:25 +0000
commit86b66b986492566cdd9a82b22e41a44446b38869 (patch)
tree609c1bce5b9eb4d051453baf71e72f7786091121
parentadf8a1d0cb146f91ceff8963bd4b95dbe015a89f (diff)
downloadcpython-git-86b66b986492566cdd9a82b22e41a44446b38869.tar.gz
Bug #1566602: correct failure of posixpath unittest when $HOME ends
with a slash. (backport from rev. 52065)
-rw-r--r--Lib/posixpath.py3
-rw-r--r--Misc/NEWS3
2 files changed, 4 insertions, 2 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index 9eac6bc13e..b396f0ace5 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 284825e352..07be792bf2 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.