Title: When importing numpy>=2.0.0, report "AssertionError: Internal error: unresolved placeholder type None" when using stubgen · Issue #17538 · python/mypy · GitHub
Open Graph Title: When importing numpy>=2.0.0, report "AssertionError: Internal error: unresolved placeholder type None" when using stubgen · Issue #17538 · python/mypy
X Title: When importing numpy>=2.0.0, report "AssertionError: Internal error: unresolved placeholder type None" when using stubgen · Issue #17538 · python/mypy
Description: Bug Report When importing lastest version of numpy>=2.0.0, report "AssertionError: Internal error: unresolved placeholder type None" when using stubgen. The error looks like this: Traceback (most recent call last): File "
Open Graph Description: Bug Report When importing lastest version of numpy>=2.0.0, report "AssertionError: Internal error: unresolved placeholder type None" when using stubgen. The error looks like this: Traceback (most r...
X Description: Bug Report When importing lastest version of numpy>=2.0.0, report "AssertionError: Internal error: unresolved placeholder type None" when using stubgen. The error looks like this: Trac...
Opengraph URL: https://github.com/python/mypy/issues/17538
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"When importing numpy>=2.0.0, report \"AssertionError: Internal error: unresolved placeholder type None\" when using stubgen","articleBody":"**Bug Report**\r\n\r\nWhen importing lastest version of numpy>=2.0.0, report \"AssertionError: Internal error: unresolved placeholder type None\" when using stubgen.\r\n\r\nThe error looks like this:\r\n```\r\nTraceback (most recent call last):\r\n File \"\u003cfrozen runpy>\", line 198, in _run_module_as_main\r\n File \"\u003cfrozen runpy>\", line 88, in _run_code\r\n File \"D:\\Program Files\\Python\\Python312\\Scripts\\stubgen.exe\\__main__.py\", line 7, in \u003cmodule>\r\n File \"mypy\\stubgen.py\", line 1882, in main\r\n File \"mypy\\stubgen.py\", line 1678, in generate_stubs\r\n File \"mypy\\stubgen.py\", line 1610, in generate_asts_for_modules\r\n File \"mypy\\build.py\", line 192, in build\r\n File \"mypy\\build.py\", line 266, in _build\r\n File \"mypy\\build.py\", line 2942, in dispatch\r\n File \"mypy\\build.py\", line 3340, in process_graph\r\n File \"mypy\\build.py\", line 3468, in process_stale_scc\r\n File \"mypy\\build.py\", line 2503, in write_cache\r\n File \"mypy\\build.py\", line 1564, in write_cache\r\n File \"mypy\\nodes.py\", line 387, in serialize\r\n File \"mypy\\nodes.py\", line 3936, in serialize\r\n File \"mypy\\nodes.py\", line 3873, in serialize\r\n File \"mypy\\nodes.py\", line 3304, in serialize\r\n File \"mypy\\types.py\", line 667, in serialize\r\n File \"mypy\\types.py\", line 2430, in serialize\r\n File \"mypy\\types.py\", line 1468, in serialize\r\n File \"mypy\\types.py\", line 667, in serialize\r\n File \"mypy\\types.py\", line 3067, in serialize\r\nAssertionError: Internal error: unresolved placeholder type None\r\n```\r\n\r\n**To Reproduce**\r\n\r\nInstall latest version of `numpy>=2.0.0`, then create a Python file with only this import, egg. `foo.py`.\r\n``` python\r\nimport numpy\r\n```\r\nusing the `stubgen` command to generate `pyi` file\r\n``` doc\r\n# stubgen .\\foo.py\r\n```\r\n\r\n**Expected Behavior**\r\n\r\ngernerated the `pyi` file via `stubgen` command\r\n\r\n**Actual Behavior**\r\n\r\nreport \"AssertionError: Internal error: unresolved placeholder type None\" when using `stubgen` command. \r\n\r\nI tried to downgrade numpy to `numpy==1.26.4` and it worked.\r\n\r\n**Your Environment**\r\n\r\n- Mypy version used: 1.10.1\r\n- Mypy command-line flags: stubgen .\\foo.py\r\n- Mypy configuration options from `mypy.ini` (and other config files): default\r\n- Python version used: 3.12.3\r\n","author":{"url":"https://github.com/JunChen1990","@type":"Person","name":"JunChen1990"},"datePublished":"2024-07-19T03:19:48Z","url":"https://github.com/python/mypy/issues/17538"}
| 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:c79d1b54-6ac1-7a7a-79a6-18666245c366 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C178:33DDEF:1F9CB47:2B411B4:6B002605 |
| html-safe-nonce | 8d7d75279ee79a7dc9fce4f1a94189f983676f7375aedbfe93262baea77a802c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTc4OjMzRERFRjoxRjlDQjQ3OjJCNDExQjQ6NkIwMDI2MDUiLCJ2aXNpdG9yX2lkIjoiMzQ0NzIxNDYwMDIwOTEzNjY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f215c4f760ce05820b9b869d0b1bf1881a4afc1e44adc03219bfca3abf3d1954 |
| hovercard-subject-tag | issue:2417778401 |
| 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/mypy/17538/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1447339a1a1f3a4e88f1dee54d666d3b379508d240dff7c78170fcaddd380693/python/mypy/issues/17538 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1447339a1a1f3a4e88f1dee54d666d3b379508d240dff7c78170fcaddd380693/python/mypy/issues/17538 |
| og:image:alt | Bug Report When importing lastest version of numpy>=2.0.0, report "AssertionError: Internal error: unresolved placeholder type None" when using stubgen. The error looks like this: Traceback (most r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JunChen1990 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width