You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Some errors are not caught by test_os.LoginTests.test_getlogin #139935
Oh, that's surprising. What is your OS name and version? What are the output of "id" and "whoami" commands? Does the test still fail after calling these commands?
Oh, that's surprising. What is your OS name and version? What are the output of "id" and "whoami" commands? Does the test still fail after calling these commands?
Python 3.15.0a0 (heads/main:34503111fe2, Oct 11 2025, 16:02:35) [GCC 11.5.0 20240719 (Red Hat 11.5.0-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
Ctrl click to launch VS Code Native REPL
>>> import os
>>> os.get_
os.get_blocking( os.get_exec_path( os.get_inheritable( os.get_terminal_size(
>>> os.getlogin()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
os.getlogin()
~~~~~~~~~~~^^
FileNotFoundError: [Errno 2] No such file or directory
>>>
>>>
the printout as show:
[hyi@rocky ~]$ id
uid=501(hyi) gid=501(hyi) groups=501(hyi),4(adm),10(wheel),39(video)
[hyi@rocky ~]$ whoami
hyi
[hyi@rocky ~]$
[hyi@rocky ~]$ uname -r
6.15.11-orbstack-00542-g4f455d264886
[hyi@rocky ~]$ uname -a
Linux rocky 6.15.11-orbstack-00542-g4f455d264886 #1 SMP PREEMPT Tue Sep 30 00:46:49 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux
[hyi@rocky ~]$ cat /proc/self/loginuid
cat: /proc/self/loginuid: No such file or directory
[hyi@rocky ~]$
changed the title [-]`test_os.LoginTests.test_getlogin` is flaky[/-][+]Some errors are not caught by `test_os.LoginTests.test_getlogin`[/+]on Oct 11, 2025
Activity
[-]flaky test for test_getlogin[/-][+]`test_os.LoginTests.test_getlogin` is flaky[/+]vstinner commentedon Oct 11, 2025
Oh, that's surprising. What is your OS name and version? What are the output of "id" and "whoami" commands? Does the test still fail after calling these commands?
yihong0618 commentedon Oct 11, 2025
Hi I am using orbstack on mac
this works
this not
the printout as show:
some digging
python use
getlogin_rthe errors may come more check doc:
https://linux.die.net/man/3/getlogin_r
picnixz commentedon Oct 11, 2025
I think we should just catch all errors that are documented on the manpage. Some are POSIX-defined and others are Linux-only.
[-]`test_os.LoginTests.test_getlogin` is flaky[/-][+]Some errors are not caught by `test_os.LoginTests.test_getlogin`[/+]yihong0618 commentedon Oct 11, 2025
Done and checked the errno file all ERROR enum do not need special check
gh-139935: fix `test_os.test_getlogin` on some platforms (#139936)
picnixz commentedon Oct 11, 2025
Thank you for the report & fix.
picnixz commentedon Oct 11, 2025
The errors being caught are actually too much, see #139936 (comment).
gh-139935: do not skip test on real errors in `os.getlogin` (#139953)