Skip to content
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

Catch OSError from getpass.getuser() #11875

Merged
merged 2 commits into from Jan 29, 2024

Conversation

rmartin16
Copy link
Contributor

@rmartin16 rmartin16 commented Jan 28, 2024

- Previously, `getpass.getuser()` would leak an ImportError if the
  USERNAME environment variable was not set on Windows because the `pwd`
  module cannot be imported.
- Starting in Python 3.13.0a3, it only raises `OSError`.
@rmartin16 rmartin16 marked this pull request as ready for review January 28, 2024 23:05
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks!

@nicoddemus nicoddemus merged commit 14d3707 into pytest-dev:main Jan 29, 2024
24 checks passed
@rmartin16 rmartin16 deleted the win-no-username-3.13-fix branch January 29, 2024 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants