Title: dmypy crash with “Invalid type comment or annotation” · Issue #10007 · python/mypy · GitHub
Open Graph Title: dmypy crash with “Invalid type comment or annotation” · Issue #10007 · python/mypy
X Title: dmypy crash with “Invalid type comment or annotation” · Issue #10007 · python/mypy
Description: Crash Report On a fresh checkout of mypy HEAD, with foo.py containing from typing import TypedDict class C(TypedDict): a: {"c": int} the command python -m mypy.dmypy run foo.py crashes the daemon. If I run just mypy, without the daemon, ...
Open Graph Description: Crash Report On a fresh checkout of mypy HEAD, with foo.py containing from typing import TypedDict class C(TypedDict): a: {"c": int} the command python -m mypy.dmypy run foo.py crashes the daemon. ...
X Description: Crash Report On a fresh checkout of mypy HEAD, with foo.py containing from typing import TypedDict class C(TypedDict): a: {"c": int} the command python -m mypy.dmypy run foo.py crashes th...
Opengraph URL: https://github.com/python/mypy/issues/10007
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"dmypy crash with “Invalid type comment or annotation”","articleBody":"**Crash Report**\r\n\r\nOn a fresh checkout of mypy HEAD, with `foo.py` containing\r\n\r\n```\r\nfrom typing import TypedDict\r\n\r\nclass C(TypedDict):\r\n a: {\"c\": int}\r\n```\r\n\r\nthe command `python -m mypy.dmypy run foo.py` crashes the daemon.\r\n\r\nIf I run just mypy, without the daemon, I get the error\r\n\r\n foo.py:4: error: Invalid type comment or annotation\r\n\r\nbut dmypy doesn’t seem to get far enough to report that.\r\n\r\n**Traceback**\r\n\r\n\u003cdetails>\r\n\u003cpre>\r\nDaemon started\r\nDaemon crashed!\r\nTraceback (most recent call last):\r\nFile \"~/git/mypy/mypy/dmypy_server.py\", line 221, in serve\r\n resp = self.run_command(command, data)\r\nFile \"~/git/mypy/mypy/dmypy_server.py\", line 264, in run_command\r\n return method(self, **data)\r\nFile \"~/git/mypy/mypy/dmypy_server.py\", line 323, in cmd_run\r\n return self.check(sources, is_tty, terminal_width)\r\nFile \"~/git/mypy/mypy/dmypy_server.py\", line 380, in check\r\n res = self.initialize_fine_grained(sources, is_tty, terminal_width)\r\nFile \"~/git/mypy/mypy/dmypy_server.py\", line 410, in initialize_fine_grained\r\n result = mypy.build.build(sources=sources,\r\nFile \"~/git/mypy/mypy/build.py\", line 180, in build\r\n result = _build(\r\nFile \"~/git/mypy/mypy/build.py\", line 254, in _build\r\n graph = dispatch(sources, manager, stdout)\r\nFile \"~/git/mypy/mypy/build.py\", line 2656, in dispatch\r\n process_graph(graph, manager)\r\nFile \"~/git/mypy/mypy/build.py\", line 2982, in process_graph\r\n process_stale_scc(graph, scc, manager)\r\nFile \"~/git/mypy/mypy/build.py\", line 3083, in process_stale_scc\r\n graph[id].finish_passes()\r\nFile \"~/git/mypy/mypy/build.py\", line 2177, in finish_passes\r\n self.update_fine_grained_deps(self.manager.fg_deps)\r\nFile \"~/git/mypy/mypy/build.py\", line 2225, in update_fine_grained_deps\r\n merge_dependencies(self.compute_fine_grained_deps(), deps)\r\nFile \"~/git/mypy/mypy/build.py\", line 2216, in compute_fine_grained_deps\r\n return get_dependencies(target=self.tree,\r\nFile \"~/git/mypy/mypy/server/deps.py\", line 114, in get_dependencies\r\n target.accept(visitor)\r\nFile \"~/git/mypy/mypy/nodes.py\", line 305, in accept\r\n return visitor.visit_mypy_file(self)\r\nFile \"~/git/mypy/mypy/server/deps.py\", line 176, in visit_mypy_file\r\n super().visit_mypy_file(o)\r\nFile \"~/git/mypy/mypy/traverser.py\", line 35, in visit_mypy_file\r\n d.accept(self)\r\nFile \"~/git/mypy/mypy/nodes.py\", line 950, in accept\r\n return visitor.visit_class_def(self)\r\nFile \"~/git/mypy/mypy/server/deps.py\", line 239, in visit_class_def\r\n super().visit_class_def(o)\r\nFile \"~/git/mypy/mypy/traverser.py\", line 71, in visit_class_def\r\n o.defs.accept(self)\r\nFile \"~/git/mypy/mypy/nodes.py\", line 1015, in accept\r\n return visitor.visit_block(self)\r\nFile \"~/git/mypy/mypy/server/deps.py\", line 351, in visit_block\r\n super().visit_block(o)\r\nFile \"~/git/mypy/mypy/traverser.py\", line 39, in visit_block\r\n s.accept(self)\r\nFile \"~/git/mypy/mypy/nodes.py\", line 1073, in accept\r\n return visitor.visit_assignment_stmt(self)\r\nFile \"~/git/mypy/mypy/server/deps.py\", line 411, in visit_assignment_stmt\r\n self.add_type_dependencies(o.type)\r\nFile \"~/git/mypy/mypy/server/deps.py\", line 808, in add_type_dependencies\r\n for trigger in self.get_type_triggers(typ):\r\nFile \"~/git/mypy/mypy/server/deps.py\", line 861, in get_type_triggers\r\n return get_type_triggers(typ, self.use_logical_deps())\r\nFile \"~/git/mypy/mypy/server/deps.py\", line 866, in get_type_triggers\r\n return typ.accept(TypeTriggersVisitor(use_logical_deps))\r\nFile \"~/git/mypy/mypy/types.py\", line 1620, in accept\r\n assert isinstance(visitor, SyntheticTypeVisitor)\r\nAssertionError\r\n\u003c/pre>\r\n\u003c/details>\r\n\r\n**To Reproduce**\r\n\r\nSee above\r\n\r\n**Your Environment**\r\n\r\npython 3.9.1 on macOS 11.1\r\n","author":{"url":"https://github.com/andrewdotn","@type":"Person","name":"andrewdotn"},"datePublished":"2021-02-01T23:28:26Z","url":"https://github.com/python/mypy/issues/10007"}
| 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:43b87f73-106b-9cd1-529c-8923c6f5a603 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A048:30CC09:2DD8F1B:3E4ABD8:6B005834 |
| html-safe-nonce | 32227a580c7638983af81ac16205cdda428ee0813f031e6b4eafa3e7dc3865b0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDQ4OjMwQ0MwOToyREQ4RjFCOjNFNEFCRDg6NkIwMDU4MzQiLCJ2aXNpdG9yX2lkIjoiODg0MzEzODY1MTYzMTM1MDI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 03fda5a1798f9314258cbdeebfeb51b1560df7e85a0e07d5e7ec7b9bd3c7a778 |
| hovercard-subject-tag | issue:798792423 |
| 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/10007/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eeb3c2a1bd8e6e05b317c053a186f5f74d064b123a2a00def08cd605f25b1099/python/mypy/issues/10007 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eeb3c2a1bd8e6e05b317c053a186f5f74d064b123a2a00def08cd605f25b1099/python/mypy/issues/10007 |
| og:image:alt | Crash Report On a fresh checkout of mypy HEAD, with foo.py containing from typing import TypedDict class C(TypedDict): a: {"c": int} the command python -m mypy.dmypy run foo.py crashes the daemon. ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andrewdotn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| 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 | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width