Feature or enhancement
Proposal:
We can replace root with the already assigned sep from earlier:
if isinstance(path, bytes):
userhome = os.fsencode(userhome)
- root = b'/'
-else:
- root = '/'
-userhome = userhome.rstrip(root)
-return (userhome + path[i:]) or root
+userhome = userhome.rstrip(sep)
+return (userhome + path[i:]) or sep
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
Linked PRs
Feature or enhancement
Proposal:
We can replace
rootwith the already assignedsepfrom earlier:if isinstance(path, bytes): userhome = os.fsencode(userhome) - root = b'/' -else: - root = '/' -userhome = userhome.rstrip(root) -return (userhome + path[i:]) or root +userhome = userhome.rstrip(sep) +return (userhome + path[i:]) or sepHas this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
_get_[both]sep[s]()calls inos.path#117634Linked PRs
sepinposixpath.expanduser()#118120