Skip to content

Commit 75dabfe

Browse files
authored
bpo-31904: posixpath.expanduser() handles None user home on VxWorks (GH-23530)
1 parent 96a09df commit 75dabfe

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Lib/posixpath.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ def expanduser(path):
262262
# password database, return the path unchanged
263263
return path
264264
userhome = pwent.pw_dir
265+
# if no user home, return the path unchanged on VxWorks
266+
if userhome is None and sys.platform == "vxworks":
267+
return path
265268
if isinstance(path, bytes):
266269
userhome = os.fsencode(userhome)
267270
root = b'/'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:func:`posixpath.expanduser` returns the input *path* unchanged if
2+
user home directory is None on VxWorks.

0 commit comments

Comments
 (0)