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.
1 parent b9e4522 commit e81af12Copy full SHA for e81af12
1 file changed
Lib/posixpath.py
@@ -250,7 +250,7 @@ def expanduser(path):
250
return path
251
try:
252
userhome = pwd.getpwuid(os.getuid()).pw_dir
253
- except KeyError:
+ except (KeyError, OSError):
254
# bpo-10496: if the current user identifier doesn't exist in the
255
# password database, return the path unchanged
256
@@ -267,7 +267,7 @@ def expanduser(path):
267
name = os.fsdecode(name)
268
269
pwent = pwd.getpwnam(name)
270
271
# bpo-10496: if the user name from the path doesn't exist in the
272
273
0 commit comments