Skip to content

gh-156261: Use the uid_t and gid_t converters in the pwd and grp modules - #156294

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:clinic-uid-gid-converters
Sep 27, 2026
Merged

serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:clinic-uid-gid-converters

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 23, 2026 •

Copy link
Copy Markdown
Member

The uid_t and gid_t converters are moved to Argument Clinic, so that pwd.getpwuid() and grp.getgrgid() can declare the type of their parameter instead of converting it in the "impl" function.

pwd.getpwuid() now raises OverflowError instead of KeyError for a user id out of the range of uid_t, as grp.getgrgid() already did.

…p modules

They are moved to Argument Clinic, so that pwd.getpwuid() and
grp.getgrgid() can declare the type of their parameter instead of
converting it in the "impl" function.

pwd.getpwuid() now raises OverflowError instead of KeyError for a user id
out of the range of uid_t, as grp.getgrgid() already did.
@serhiy-storchaka
serhiy-storchaka merged commit db3ffd0 into python:main Sep 27, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant