summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-04-02 22:30:03 (GMT)
committerGuido van Rossum <guido@python.org>1996-04-02 22:30:03 (GMT)
commitbbb4e10e91f231bcb1cb012198b2262333f3e0ed (patch)
treef803e0c66c51e825c117ae831ffdd4ea5c8daefb /Lib
parentededb58c140c74cd805b568c50edccb213a13b1a (diff)
downloadcpython-bbb4e10e91f231bcb1cb012198b2262333f3e0ed.zip
cpython-bbb4e10e91f231bcb1cb012198b2262333f3e0ed.tar.gz
cpython-bbb4e10e91f231bcb1cb012198b2262333f3e0ed.tar.bz2
Subtlety: ~root/a should expand to /a, not //a. Everything else unchanged.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/posixpath.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index c288f3b..d284834 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -241,6 +241,7 @@ def expanduser(path):
except KeyError:
return path
userhome = pwent[5]
+ if userhome[-1:] == '/': i = i+1
return userhome + path[i:]