Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
sep
posixpath.expanduser()
1 parent 1e42842 commit 6f768b7Copy full SHA for 6f768b7
1 file changed
Lib/posixpath.py
@@ -298,11 +298,8 @@ def expanduser(path):
298
return path
299
if isinstance(path, bytes):
300
userhome = os.fsencode(userhome)
301
- root = b'/'
302
- else:
303
- root = '/'
304
- userhome = userhome.rstrip(root)
305
- return (userhome + path[i:]) or root
+ userhome = userhome.rstrip(sep)
+ return (userhome + path[i:]) or sep
306
307
308
# Expand paths containing shell variable substitutions.
0 commit comments