René's URL Explorer Experiment


Title: gh-101607 causes regression in third-party psutil package on macOS · Issue #102493 · python/cpython · GitHub

Open Graph Title: gh-101607 causes regression in third-party psutil package on macOS · Issue #102493 · python/cpython

X Title: gh-101607 causes regression in third-party psutil package on macOS · Issue #102493 · python/cpython

Description: As part of the cPython release process for macOS installers, besides the standard cPython test suite, we run a small set of additional smoke tests. One of these involves an install from source of the psutil package which includes the bui...

Open Graph Description: As part of the cPython release process for macOS installers, besides the standard cPython test suite, we run a small set of additional smoke tests. One of these involves an install from source of t...

X Description: As part of the cPython release process for macOS installers, besides the standard cPython test suite, we run a small set of additional smoke tests. One of these involves an install from source of t...

Opengraph URL: https://github.com/python/cpython/issues/102493

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"gh-101607 causes regression in third-party psutil package on macOS","articleBody":"As part of the cPython release process for macOS installers, besides the standard cPython test suite, we run a small set of additional smoke tests. One of these involves an install from source of [the psutil package](https://github.com/giampaolo/psutil) which includes the building of a C extension module. In the run up to the 3.12.0a6 release, we found that our long-unchanged simple test was now failing, a regression from 3.12.0a5 and 3.11.x. The commit causing the failure was bisected to feec49c40736fc05626a183a8d14c4ebbea5ae28 from GH-101607, a part of issue #101578. From a cursory glance at the traceback and the psutil code, it appears that psutil uses a [decorator to translate certain OSError exceptions](https://github.com/giampaolo/psutil/blob/master/psutil/_psosx.py#L339) from its C module into other Python exceptions that its calling code is prepared to handle or ignore. For some reason, that exception translation is now failing. FWIW, this is the first failure of this psutil smoke test in recent memory including previous 3.12.0 alphas. Also, FWIW, this same smoke test does not fail on a reasonably recent Debian Linux system but, of course, that exercises a different platform-dependent code path in psutil.\r\n\r\nBecause of its dependencies, it is a bit complicated to build and reproduce without changes. Here is one way to do it; it is likely not optimal. This assumes a fairly recent macOS system with Homebrew installed (as described in the devguide) and assumes git checkouts of the cpython and psutil Github repos.\r\n\r\n```\r\nbrew install pkg-config openssl@1.1 xz\r\n\r\nmkdir /tmp/test_psutil\r\ncd /tmp/test_psutil\r\ngit clone https://github.com/giampaolo/psutil.git\r\ngit clone https://github.com/python/cpython.git # or from an existing repo\r\n\r\ncd cpython\r\ngit checkout feec49c40736fc05626a183a8d14c4ebbea5ae28^ # last good commit\r\ngit clean -fdxq\r\n./configure -q  --prefix=/tmp/none --with-pydebug \\\r\n              --with-openssl=\"$(brew --prefix openssl@1.1)\"\r\nmake -s -j2\r\ncd ..\r\ngit -C ./psutil clean -fdxq\r\nrm -rf venv\r\n./cpython/python.exe -m venv venv\r\nvenv/bin/python -m pip install --no-binary psutil ./psutil/\r\nvenv/bin/python -c 'import psutil, pprint; pprint.pprint(list(psutil.process_iter()))'\r\n```\r\nThe expected result should be something like:\r\n\r\n\r\n```\r\n[psutil.Process(pid=0, name='kernel_task', status='running', started='03:25:52'),\r\n psutil.Process(pid=1, name='launchd', status='running', started='03:25:52'),\r\n psutil.Process(pid=75, name='logd', status='running', started='03:25:54'),\r\n psutil.Process(pid=76, name='UserEventAgent', status='running', started='03:25:54'),\r\n ...\r\n\r\n```\r\n\r\nWith the failing commit applied (up to and including the current head of the main branch):\r\n\r\n`git checkout feec49c40736fc05626a183a8d14c4ebbea5ae28 # failing commit\r\n`\r\n\r\nand repeating the above build and test, the result is now something like:\r\n\r\n \r\n```\r\nTraceback (most recent call last):\r\n  File \"\u003cstring\u003e\", line 1, in \u003cmodule\u003e\r\n  File \"/private/tmp/cpython/Lib/pprint.py\", line 55, in pprint\r\n    printer.pprint(object)\r\n  File \"/private/tmp/cpython/Lib/pprint.py\", line 153, in pprint\r\n    self._format(object, self._stream, 0, 0, {}, 0)\r\n  File \"/private/tmp/cpython/Lib/pprint.py\", line 175, in _format\r\n    rep = self._repr(object, context, level)\r\n          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"/private/tmp/cpython/Lib/pprint.py\", line 455, in _repr\r\n    repr, readable, recursive = self.format(object, context.copy(),\r\n                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"/private/tmp/cpython/Lib/pprint.py\", line 468, in format\r\n    return self._safe_repr(object, context, maxlevels, level)\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"/private/tmp/cpython/Lib/pprint.py\", line 619, in _safe_repr\r\n    orepr, oreadable, orecur = self.format(\r\n                               ^^^^^^^^^^^^\r\n  File \"/private/tmp/cpython/Lib/pprint.py\", line 468, in format\r\n    return self._safe_repr(object, context, maxlevels, level)\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"/private/tmp/cpython/Lib/pprint.py\", line 629, in _safe_repr\r\n    rep = repr(object)\r\n          ^^^^^^^^^^^^\r\n  File \"/private/tmp/venv/lib/python3.12/site-packages/psutil/__init__.py\", line 389, in __str__\r\n    info[\"name\"] = self.name()\r\n                   ^^^^^^^^^^^\r\n  File \"/private/tmp/venv/lib/python3.12/site-packages/psutil/__init__.py\", line 628, in name\r\n    cmdline = self.cmdline()\r\n              ^^^^^^^^^^^^^^\r\n  File \"/private/tmp/venv/lib/python3.12/site-packages/psutil/__init__.py\", line 681, in cmdline\r\n    return self._proc.cmdline()\r\n           ^^^^^^^^^^^^^^^^^^^^\r\n  File \"/private/tmp/venv/lib/python3.12/site-packages/psutil/_psosx.py\", line 346, in wrapper\r\n    return fun(self, *args, **kwargs)\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"/private/tmp/venv/lib/python3.12/site-packages/psutil/_psosx.py\", line 404, in cmdline\r\n    return cext.proc_cmdline(self.pid)\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\nOSError: [Errno 1] Operation not permitted (originated from sysctl(KERN_PROCARGS2))\r\n\r\n```\r\n\r\nNote this seems to come from trying to inspect a privileged process and the point of the exception wrapping is to effectively ignore such errors.\r\n\r\nFlagging as a potential release-blocker for @Yhg1s\r\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-102502\n* gh-102602\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/ned-deily","@type":"Person","name":"ned-deily"},"datePublished":"2023-03-07T09:56:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/102493/cpython/issues/102493"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:2bf29f32-acab-9efb-7c25-ed8a5e021e0b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAF7E:225E33:9D20EC:D34E14:69697E27
html-safe-nonced1d5c3950fdf71431b7d10539e7982a08049dfb99f5126db1baae7946ebb9752
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjdFOjIyNUUzMzo5RDIwRUM6RDM0RTE0OjY5Njk3RTI3IiwidmlzaXRvcl9pZCI6IjMyMzU0MDQ5MDQ1NjkzMzk0MzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca5cc65cb97c2e7e4413fd0a9fda561aa73fd55dc4afd6276aaeff1e3c587f2dc
hovercard-subject-tagissue:1613091359
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/102493/issue_layout
twitter:imagehttps://opengraph.githubassets.com/62fee32ecf5bb24de5628bdec492c97c693b5aebf0a6dd23dbf6342cb0a9d061/python/cpython/issues/102493
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/62fee32ecf5bb24de5628bdec492c97c693b5aebf0a6dd23dbf6342cb0a9d061/python/cpython/issues/102493
og:image:altAs part of the cPython release process for macOS installers, besides the standard cPython test suite, we run a small set of additional smoke tests. One of these involves an install from source of t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamened-deily
hostnamegithub.com
expected-hostnamegithub.com
Nonef33e4b94c8824ab2b434d82a94139432fb5ebee9df4b75304140ad22508c4a77
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release48f380098b30acbb700b04f1724481ca10d574fc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/102493#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F102493
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F102493
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/102493
Reloadhttps://github.com/python/cpython/issues/102493
Reloadhttps://github.com/python/cpython/issues/102493
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/102493
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/issues/102493
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/102493
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/102493
#102502https://github.com/python/cpython/pull/102502
gh-101607 causes regression in third-party psutil package on macOShttps://github.com/python/cpython/issues/102493#top
#102502https://github.com/python/cpython/pull/102502
https://github.com/markshannon
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
release-blockerhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22release-blocker%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/ned-deily
https://github.com/ned-deily
ned-deilyhttps://github.com/ned-deily
on Mar 7, 2023https://github.com/python/cpython/issues/102493#issue-1613091359
the psutil packagehttps://github.com/giampaolo/psutil
feec49chttps://github.com/python/cpython/commit/feec49c40736fc05626a183a8d14c4ebbea5ae28
GH-101607https://github.com/python/cpython/pull/101607
#101578https://github.com/python/cpython/issues/101578
decorator to translate certain OSError exceptionshttps://github.com/giampaolo/psutil/blob/master/psutil/_psosx.py#L339
@Yhg1shttps://github.com/Yhg1s
gh-102493: fix normalization in PyErr_SetObject #102502https://github.com/python/cpython/pull/102502
[3.11] gh-102493: backport unit test for PyErr_SetObject #102602https://github.com/python/cpython/pull/102602
markshannonhttps://github.com/markshannon
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
release-blockerhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22release-blocker%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
Release and Deferred blockers 🚫https://github.com/orgs/python/projects/2
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.