-
-
Couldn't load subscription status.
- Fork 33.3k
Closed
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesOS-linuxtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
[hyi@rocky cpython]$ ./python -m unittest test.test_os.test_os.LoginTests.test_getlogin -v
test_getlogin (test.test_os.test_os.LoginTests.test_getlogin) ... ERROR
======================================================================
ERROR: test_getlogin (test.test_os.test_os.LoginTests.test_getlogin)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/hyi/cpython/Lib/test/test_os/test_os.py", line 3204, in test_getlogin
user_name = os.getlogin()
FileNotFoundError: [Errno 2] No such file or directory
----------------------------------------------------------------------
Ran 1 test in 0.002s
FAILED (errors=1)
This test bring back in patch #139498
but in some system there will be a FileNotFoundError
since FileNotFoundError is a subclass of OSError
but the errno maybe ENOENT in some linux
cc @vstinner
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
3.15new features, bugs and security fixesnew features, bugs and security fixesOS-linuxtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error