Title: Some errors are not caught by `test_os.LoginTests.test_getlogin` · Issue #139935 · python/cpython · GitHub
Open Graph Title: Some errors are not caught by `test_os.LoginTests.test_getlogin` · Issue #139935 · python/cpython
X Title: Some errors are not caught by `test_os.LoginTests.test_getlogin` · Issue #139935 · python/cpython
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 ==============================================...
Open Graph 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 ======...
X 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 ======...
Opengraph URL: https://github.com/python/cpython/issues/139935
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Some errors are not caught by `test_os.LoginTests.test_getlogin`","articleBody":"# Bug report\n\n### Bug description:\n\n```cli\n[hyi@rocky cpython]$ ./python -m unittest test.test_os.test_os.LoginTests.test_getlogin -v\n\ntest_getlogin (test.test_os.test_os.LoginTests.test_getlogin) ... ERROR\n\n======================================================================\nERROR: test_getlogin (test.test_os.test_os.LoginTests.test_getlogin)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/home/hyi/cpython/Lib/test/test_os/test_os.py\", line 3204, in test_getlogin\n user_name = os.getlogin()\nFileNotFoundError: [Errno 2] No such file or directory\n\n----------------------------------------------------------------------\nRan 1 test in 0.002s\n\nFAILED (errors=1)\n```\n\nThis test bring back in patch https://github.com/python/cpython/pull/139498\n\nbut in some system there will be a FileNotFoundError\nsince FileNotFoundError is a subclass of OSError \nbut the errno maybe `ENOENT` in some linux\n\ncc @vstinner \n\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-139936\n* gh-139953\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/yihong0618","@type":"Person","name":"yihong0618"},"datePublished":"2025-10-11T05:10:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/139935/cpython/issues/139935"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5a2ba6c5-cb41-f058-593e-6d27b06dab87 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E910:33F2B1:69333:923F4:6A550D29 |
| html-safe-nonce | 606379f3643c205ec63d42d6914377e45a3bf4572f27addac88bd010d2351e30 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTEwOjMzRjJCMTo2OTMzMzo5MjNGNDo2QTU1MEQyOSIsInZpc2l0b3JfaWQiOiIxMjcxMTc1Mzc3ODIyNDg1ODAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c3ed467c994db25eff351f1fef11ae2f2f731f47d1ef48f22112f7d96a905622 |
| hovercard-subject-tag | issue:3505206593 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/139935/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4e2c16168562de810e4ff800c2b6e7abb74c9b02aa6d16615769726746693673/python/cpython/issues/139935 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4e2c16168562de810e4ff800c2b6e7abb74c9b02aa6d16615769726746693673/python/cpython/issues/139935 |
| og:image:alt | 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 ======... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yihong0618 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 682d273eacb2ac51680c6eb9c0b270f029f7ce74c32090f319083c34497e28a5 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0f2adbaa4b43ea302b02981f637a782ae92ed6dc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width