[issue46631] Implement a "strict" mode for getpass.getuser()

2022-02-04 Thread Eryk Sun
Eryk Sun added the comment: Here's an example for the suggested changes to _winapi. Include these headers: #include // LsaGetLogonSessionData #include // STATUS_SUCCESS Add these argument-clinic macros to _winapi_functions: _WINAPI_GETCURRENTPROCESSTOKEN_METHODDEF _WINAPI_

[issue46631] Implement a "strict" mode for getpass.getuser()

2022-02-03 Thread Eryk Sun
New submission from Eryk Sun : getpass.getuser() checks the environment variables LOGNAME (login name), USER, LNAME, and USERNAME, in that order. In Windows, LOGNAME, USER, and LNAME have no conventional usage. I think there should be a strict mode that restricts getuser() to check only USERN