]> granicus.if.org Git - python/commitdiff
Bug #1566602: correct failure of posixpath unittest when $HOME ends
authorGeorg Brandl <georg@python.org>
Sat, 30 Sep 2006 09:13:29 +0000 (09:13 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 30 Sep 2006 09:13:29 +0000 (09:13 +0000)
with a slash.
 (backport from rev. 52065)

Lib/posixpath.py
Misc/NEWS

index 9eac6bc13ebc697798b37aa70bdc4386e5f6b799..b396f0ace5ec635e1c45ed40b28fe5272c6957f5 100644 (file)
@@ -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:]
 
 
index 6f6d0a42712c7b010ce1436d19f704eeb6b0e532..56e0e2beb65ad6de5417201320b20707b7d9b083 100644 (file)
--- 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.