summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-09-30 09:13:29 +0000
committerGeorg Brandl <georg@python.org>2006-09-30 09:13:29 +0000
commit9c9a9ab6340eb2225f57fbef6d6cf9e3da547142 (patch)
tree4d72ca3af030913563863af6a7790eceff099c5a
parentad4e11e16d6ece17980e59a3b6474d0a186ffb56 (diff)
downloadcpython-git-9c9a9ab6340eb2225f57fbef6d6cf9e3da547142.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 6f6d0a4271..56e0e2beb6 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -41,6 +41,9 @@ Extension Modules
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.