summaryrefslogtreecommitdiffstats
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-04-05 14:48:49 (GMT)
committerGeorg Brandl <georg@python.org>2009-04-05 14:48:49 (GMT)
commit3f0ef20269aef0408a0a325bf5300a1ca676aa52 (patch)
tree203634c46d7f761c9aec9780b0a744775cc8047d /Lib/posixpath.py
parenta7ec0726e2783c3ba886707df2a8ddd0e7e909db (diff)
downloadcpython-3f0ef20269aef0408a0a325bf5300a1ca676aa52.zip
cpython-3f0ef20269aef0408a0a325bf5300a1ca676aa52.tar.gz
cpython-3f0ef20269aef0408a0a325bf5300a1ca676aa52.tar.bz2
#5471: fix expanduser() for $HOME set to "/".
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r--Lib/posixpath.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index 6eb45fd..0ec430d 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -262,7 +262,7 @@ def expanduser(path):
except KeyError:
return path
userhome = pwent.pw_dir
- userhome = userhome.rstrip('/')
+ userhome = userhome.rstrip('/') or userhome
return userhome + path[i:]