forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-48511: Make pwd and grp expose inner errors
Distinguish between the case when the user/group does not exist and error conditions. If the user does not exit, raise KeyError as now, for errors raise OSError.
- Loading branch information
1 parent
81bf10e
commit a27c3ae
Showing
3 changed files
with
54 additions
and
32 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
Misc/NEWS.d/next/Library/2023-02-24-18-17-01.gh-issue-48511.a7Tra5.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
The Unix user (:func:`pwd.getpwuid`, :func:`pwd.getpwnam`) and group ( | ||
:func:`grp.getgrgid`, :func:`grp.getgrnam`) database functions now | ||
differentiate between a lack of record (:exc:`KeyError` is risen, the current behaviour) | ||
and a database access error (:exc:`OSError` is risen). | ||
|
||
Based on a patch by Oleg Iarygin. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters