[8.0.x] Catch OSError from getpass.getuser() (#11876)
Co-authored-by: Russell Martin <russell@rjm.li>
This commit is contained in:
committed by
GitHub
parent
169d775eec
commit
8b70bb64d3
1
AUTHORS
1
AUTHORS
@@ -338,6 +338,7 @@ Ronny Pfannschmidt
|
||||
Ross Lawley
|
||||
Ruaridh Williamson
|
||||
Russel Winder
|
||||
Russell Martin
|
||||
Ryan Puddephatt
|
||||
Ryan Wooden
|
||||
Sadra Barikbin
|
||||
|
||||
1
changelog/11875.bugfix.rst
Normal file
1
changelog/11875.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
||||
Correctly handle errors from :func:`getpass.getuser` in Python 3.13.
|
||||
@@ -203,7 +203,7 @@ def get_user() -> Optional[str]:
|
||||
import getpass
|
||||
|
||||
return getpass.getuser()
|
||||
except (ImportError, KeyError):
|
||||
except (ImportError, OSError, KeyError):
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user