Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Some errors are not caught by test_os.LoginTests.test_getlogin #139935

Copy link
Copy link
@yihong0618

Description

@yihong0618
Issue body actions

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

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, 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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.