summaryrefslogtreecommitdiffstats
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-09-29 16:59:18 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-09-29 16:59:18 (GMT)
commit16004ace5bb9b566b68e9016926e88d78edbbf50 (patch)
tree4253a76a37e92fb350224e1615ef3ee1277b07b8 /Lib/posixpath.py
parentc39211f51e377919952b139c46e295800cbc2a8d (diff)
downloadcpython-16004ace5bb9b566b68e9016926e88d78edbbf50.zip
cpython-16004ace5bb9b566b68e9016926e88d78edbbf50.tar.gz
cpython-16004ace5bb9b566b68e9016926e88d78edbbf50.tar.bz2
Use os.fsencode() to support surrogates
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 37da71e..2d68b73 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -262,7 +262,7 @@ def expanduser(path):
return path
userhome = pwent.pw_dir
if isinstance(path, bytes):
- userhome = userhome.encode(sys.getfilesystemencoding())
+ userhome = os.fsencode(userhome)
root = b'/'
else:
root = '/'