8000 bpo-31904: posixpath.expanduser() handles user home of None by pxinwr · Pull Request #23530 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-31904: posixpath.expanduser() handles user home of None #23530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Lib/posixpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ def expanduser(path):
# password database, return the path unchanged
return path
userhome = pwent.pw_dir
# if no user home, return the path unchanged on VxWorks
if userhome is None and sys.platform == "vxworks":
return path
if isinstance(path, bytes):
userhome = os.fsencode(userhome)
root = b'/'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:func:`posixpath.expanduser` returns the input *path* unchanged if
user home directory is None on VxWorks.
0