Browse Source

bpo-31904: posixpath.expanduser() handles None user home on VxWorks (GH-23530)

pull/23826/head
pxinwr 6 years ago
committed by GitHub
parent
commit
75dabfe7a8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      Lib/posixpath.py
  2. 2
      Misc/NEWS.d/next/Library/2020-11-27-18-09-59.bpo-31904.g8k43d.rst

3
Lib/posixpath.py

@ -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'/'

2
Misc/NEWS.d/next/Library/2020-11-27-18-09-59.bpo-31904.g8k43d.rst

@ -0,0 +1,2 @@
:func:`posixpath.expanduser` returns the input *path* unchanged if
user home directory is None on VxWorks.
Loading…
Cancel
Save