]> 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:25 +0000 (09:13 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 30 Sep 2006 09:13:25 +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 284825e352f198d6179e2a2b66fa95d28f5f5709..07be792bf28e3350b220dff699bf113f8a4ed209 100644 (file)
--- 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.