diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-09-29 16:59:18 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-09-29 16:59:18 (GMT) |
commit | 16004ace5bb9b566b68e9016926e88d78edbbf50 (patch) | |
tree | 4253a76a37e92fb350224e1615ef3ee1277b07b8 /Lib | |
parent | c39211f51e377919952b139c46e295800cbc2a8d (diff) | |
download | cpython-16004ace5bb9b566b68e9016926e88d78edbbf50.zip cpython-16004ace5bb9b566b68e9016926e88d78edbbf50.tar.gz cpython-16004ace5bb9b566b68e9016926e88d78edbbf50.tar.bz2 |
Use os.fsencode() to support surrogates
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/posixpath.py | 2 |
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 = '/' |