Title: Failure when running `test_inspect` locally · Issue #136549 · python/cpython · GitHub
Open Graph Title: Failure when running `test_inspect` locally · Issue #136549 · python/cpython
X Title: Failure when running `test_inspect` locally · Issue #136549 · python/cpython
Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.
Open Graph Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.
X Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.
Opengraph URL: https://github.com/python/cpython
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Failure when running `test_inspect` locally","articleBody":"# Bug report\n\n### Bug description:\n\nWhen running `test_inspect` locally (either via `unittest` or via executing `Lib/test/test_inspect/test_inspect.py`), I see this failure:\n\n```\nERROR: test_threading_module_has_signatures (__main__.TestSignatureDefinitions.test_threading_module_has_signatures) [supported] (builtin='excepthook')\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/home/peter/develop/cpython/Lib/test/test_inspect/test_inspect.py\", line 5717, in _test_module_has_signatures\n self.assertIsNotNone(inspect.signature(obj))\n ~~~~~~~~~~~~~~~~~^^^^^\n File \"/home/peter/develop/cpython/Lib/inspect.py\", line 3312, in signature\n return Signature.from_callable(obj, follow_wrapped=follow_wrapped,\n ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n globals=globals, locals=locals, eval_str=eval_str,\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n annotation_format=annotation_format)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/home/peter/develop/cpython/Lib/inspect.py\", line 3027, in from_callable\n return _signature_from_callable(obj, sigcls=cls,\n follow_wrapper_chains=follow_wrapped,\n globals=globals, locals=locals, eval_str=eval_str,\n annotation_format=annotation_format)\n File \"/home/peter/develop/cpython/Lib/inspect.py\", line 2508, in _signature_from_callable\n return _signature_from_builtin(sigcls, obj,\n skip_bound_arg=skip_bound_arg)\n File \"/home/peter/develop/cpython/Lib/inspect.py\", line 2294, in _signature_from_builtin\n return _signature_fromstr(cls, func, s, skip_bound_arg)\n File \"/home/peter/develop/cpython/Lib/inspect.py\", line 2150, in _signature_fromstr\n raise ValueError(\"{!r} builtin has invalid signature\".format(obj))\nValueError: \u003cbuilt-in function _excepthook> builtin has invalid signature\n```\n\nI'm able to reproduce this back to 3.13, so it's definitely not a recent failure.\n\nInterestingly, this failure *does not* show up when running through regrtest (`python -m test test_inspect`), both in CI or locally. I'm not sure if this is a misconfiguration that regrtest fixes, or an actual bug that's being hidden.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-136559\n* gh-136589\n* gh-136590\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/ZeroIntensity","@type":"Person","name":"ZeroIntensity"},"datePublished":"2025-07-11T15:46:59Z","url":"https://github.com/python/cpython/issues/136549"}
| 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 | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:a387422f-c145-0b28-87a5-746fe42ce328 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA32:3DFA13:3438A:4705E:6B0017A9 |
| html-safe-nonce | 664654749403280ee0d002c5b47703c7ba298ef8326de3c9ae0de03ebdf2e935 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTMyOjNERkExMzozNDM4QTo0NzA1RTo2QjAwMTdBOSIsInZpc2l0b3JfaWQiOiI3MTg2MTU5ODQyMDIzNzA4NTg1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | de7318efe78182acc674fa44852c5e97d7dfab63938f98e70cec335e6310299b |
| hovercard-subject-tag | repository:81598961 |
| 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/python/cpython/issues/136549 |
| twitter:image | https://opengraph.githubassets.com/7ad4b91f85ba88fd19345e5be36d04b258215ebdb6e9cc5d44c84e6feaf6d5ea/python/cpython |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7ad4b91f85ba88fd19345e5be36d04b258215ebdb6e9cc5d44c84e6feaf6d5ea/python/cpython |
| og:image:alt | The Python programming language. Contribute to python/cpython development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | a2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4 |
| turbo-cache-control | no-cache |
| 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 | 70121d4e855ee0bb7b75cf15d061d91f8863c0f8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width