]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Bug #1566602: correct failure of posixpath unittest when $HOME ends
authorGeorg Brandl <georg@python.org>
Sat, 30 Sep 2006 09:13:21 +0000 (09:13 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 30 Sep 2006 09:13:21 +0000 (09:13 +0000)
with a slash.

Lib/posixpath.py
Misc/NEWS

index 9dd0e9079d0150f4f601b4c3ad1e90a52d15cb2a..07ab4b672c783cec1b3843085f781dc6dd7c9bef 100644 (file)
@@ -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:]
 
 
index 4acce5c4e65e5a15c2d20ea80b91acc792e736ce..6d048cc13798c15efd7e42de8cd9d0f67f8b2f23 100644 (file)
--- 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.