Title: `test_perf_profiler` fails under Windows Subsystem for Linux · Issue #134986 · python/cpython · GitHub
Open Graph Title: `test_perf_profiler` fails under Windows Subsystem for Linux · Issue #134986 · python/cpython
X Title: `test_perf_profiler` fails under Windows Subsystem for Linux · Issue #134986 · python/cpython
Description: Bug report The culprit is that for some reason calling perf from the WSL raises a PermissionError, rather than FileNotFoundError or CalledProcessError when perf is not available. Example output: $ which perf # not present $ ./python -m t...
Open Graph Description: Bug report The culprit is that for some reason calling perf from the WSL raises a PermissionError, rather than FileNotFoundError or CalledProcessError when perf is not available. Example output: $ ...
X Description: Bug report The culprit is that for some reason calling perf from the WSL raises a PermissionError, rather than FileNotFoundError or CalledProcessError when perf is not available. Example output: $ ...
Opengraph URL: https://github.com/python/cpython/issues/134986
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`test_perf_profiler` fails under Windows Subsystem for Linux","articleBody":"# Bug report\n\nThe culprit is that for some reason calling `perf` from the WSL raises a `PermissionError`, rather than `FileNotFoundError` or `CalledProcessError` when `perf` is not available.\n\nExample output:\n\n```\n$ which perf # not present\n$ ./python -m test test_perf_profiler -v\n== CPython 3.15.0a0 (heads/main:3704171415c, May 31 2025, 12:20:03) [Clang 20.1.6 (++20250528122018+47addd4540b4-1~exp1~20250528002033.124)]\n== Linux-6.6.87.1-microsoft-standard-WSL2-x86_64-with-glibc2.39 little-endian\n== Python build: debug\n== cwd: /home/emma/cpython/build/test_python_worker_7822æ\n== CPU count: 32\n== encodings: locale=UTF-8 FS=utf-8\n== resources: all test resources are disabled, use -u option to unskip tests\n\nUsing random seed: 1838771651\n0:00:00 load avg: 0.65 Run 1 test sequentially in a single process\n0:00:00 load avg: 0.65 [1/1] test_perf_profiler\ntest test_perf_profiler crashed -- Traceback (most recent call last):\n File \"/home/emma/cpython/Lib/test/libregrtest/single.py\", line 210, in _runtest_env_changed_exc\n _load_run_test(result, runtests)\n ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^\n File \"/home/emma/cpython/Lib/test/libregrtest/single.py\", line 155, in _load_run_test\n test_mod = importlib.import_module(module_name)\n File \"/home/emma/cpython/Lib/importlib/__init__.py\", line 88, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"\u003cfrozen importlib._bootstrap>\", line 1398, in _gcd_import\n File \"\u003cfrozen importlib._bootstrap>\", line 1371, in _find_and_load\n File \"\u003cfrozen importlib._bootstrap>\", line 1342, in _find_and_load_unlocked\n File \"\u003cfrozen importlib._bootstrap>\", line 938, in _load_unlocked\n File \"\u003cfrozen importlib._bootstrap_external>\", line 762, in exec_module\n File \"\u003cfrozen importlib._bootstrap>\", line 491, in _call_with_frames_removed\n File \"/home/emma/cpython/Lib/test/test_perf_profiler.py\", line 522, in \u003cmodule>\n _is_perf_version_at_least(6, 6), \"perf command may not work due to a perf bug\"\n ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\n File \"/home/emma/cpython/Lib/test/test_perf_profiler.py\", line 510, in _is_perf_version_at_least\n output = subprocess.check_output([\"perf\", \"--version\"], text=True)\n File \"/home/emma/cpython/Lib/subprocess.py\", line 472, in check_output\n return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n **kwargs).stdout\n ^^^^^^^^^\n File \"/home/emma/cpython/Lib/subprocess.py\", line 554, in run\n with Popen(*popenargs, **kwargs) as process:\n ~~~~~^^^^^^^^^^^^^^^^^^^^^^\n File \"/home/emma/cpython/Lib/subprocess.py\", line 1038, in __init__\n self._execute_child(args, executable, preexec_fn, close_fds,\n ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n pass_fds, cwd, env,\n ^^^^^^^^^^^^^^^^^^^\n ...\u003c5 lines>...\n gid, gids, uid, umask,\n ^^^^^^^^^^^^^^^^^^^^^^\n start_new_session, process_group)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/home/emma/cpython/Lib/subprocess.py\", line 1970, in _execute_child\n raise child_exception_type(errno_num, err_msg, err_filename)\nPermissionError: [Errno 13] Permission denied: 'perf'\n\n0:00:00 load avg: 0.65 [1/1/1] test_perf_profiler failed (uncaught exception)\n\n== Tests result: FAILURE ==\n\n1 test failed:\n test_perf_profiler\n\nTotal duration: 270 ms\nTotal tests: run=0\nTotal test files: run=1/1 failed=1\nResult: FAILURE\n```\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-134987\n* gh-135841\n* gh-135842\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/emmatyping","@type":"Person","name":"emmatyping"},"datePublished":"2025-05-31T19:36:21Z","url":"https://github.com/python/cpython/issues/134986"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:c0d3d84e-0018-cad4-e36b-b93f68c5afcb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B682:22DB35:4719512:5A81E5A:6B023339 |
| html-safe-nonce | e9c6110d17d5eecb5824003be1d344acfdd5dd7a175258c9910f350d9c30ee99 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjgyOjIyREIzNTo0NzE5NTEyOjVBODFFNUE6NkIwMjMzMzkiLCJ2aXNpdG9yX2lkIjoiMzI3OTMxODQ0MTIzMTc5MDkwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 96dab101297565d3e35c91d6bb45f2a3d70ad15c4f0638892379062ca6171ef2 |
| hovercard-subject-tag | issue:3105947049 |
| 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/134986/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cc8e14ec6db90b71bd0898d30ed01c4ce78c21187695012a0a83cbaf900de186/python/cpython/issues/134986 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cc8e14ec6db90b71bd0898d30ed01c4ce78c21187695012a0a83cbaf900de186/python/cpython/issues/134986 |
| og:image:alt | Bug report The culprit is that for some reason calling perf from the WSL raises a PermissionError, rather than FileNotFoundError or CalledProcessError when perf is not available. Example output: $ ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | emmatyping |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width