Skip to content

gh-116738: Make pwd module thread-safe #136695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2025
Merged

gh-116738: Make pwd module thread-safe #136695

merged 1 commit into from
Jul 17, 2025

Conversation

yoney
Copy link
Contributor

@yoney yoney commented Jul 15, 2025

Make the pwd module functions getpwuid(), getpwnam(), and getpwall() thread-safe. These changes apply to scenarios where the GIL is disabled or in subinterpreter use cases.

cc: @mpage @colesbury @Yhg1s

@yoney
Copy link
Contributor Author

yoney commented Jul 15, 2025

Note: I am not sure if there is a CI setup where getpwuid_r()/getpwnam_r() are not available. I tested those manually on my local machine.

@yoney yoney marked this pull request as ready for review July 15, 2025 22:59
@yoney yoney requested a review from ericsnowcurrently as a code owner July 15, 2025 22:59
@mpage mpage requested review from mpage, colesbury and Yhg1s July 16, 2025 17:06
Copy link
Contributor

@mpage mpage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I'll wait to merge for a day or two to give other folks a chance to look.

@mpage mpage merged commit eddc8c0 into python:main Jul 17, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants