René's URL Explorer Experiment


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

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@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-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:43b87f73-106b-9cd1-529c-8923c6f5a603
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA048:30CC09:2DD8F1B:3E4ABD8:6B005834
html-safe-nonce32227a580c7638983af81ac16205cdda428ee0813f031e6b4eafa3e7dc3865b0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDQ4OjMwQ0MwOToyREQ4RjFCOjNFNEFCRDg6NkIwMDU4MzQiLCJ2aXNpdG9yX2lkIjoiODg0MzEzODY1MTYzMTM1MDI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac03fda5a1798f9314258cbdeebfeb51b1560df7e85a0e07d5e7ec7b9bd3c7a778
hovercard-subject-tagissue:798792423
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/mypy/10007/issue_layout
twitter:imagehttps://opengraph.githubassets.com/eeb3c2a1bd8e6e05b317c053a186f5f74d064b123a2a00def08cd605f25b1099/python/mypy/issues/10007
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/eeb3c2a1bd8e6e05b317c053a186f5f74d064b123a2a00def08cd605f25b1099/python/mypy/issues/10007
og:image:altCrash 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:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameandrewdotn
hostnamegithub.com
expected-hostnamegithub.com
None29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73
turbo-cache-controlno-preview
go-importgithub.com/python/mypy git https://github.com/python/mypy.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id7053637
octolytics-dimension-repository_nwopython/mypy
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7053637
octolytics-dimension-repository_network_root_nwopython/mypy
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
releaseeacd927ba6112e3b01ba99c762bd699a4a4f5df7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/10007#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F10007
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F10007
Sign uphttps://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%2Fmypy
Reloadhttps://github.com/python/mypy/issues/10007
Reloadhttps://github.com/python/mypy/issues/10007
Reloadhttps://github.com/python/mypy/issues/10007
pythonhttps://github.com/python
mypyhttps://github.com/python/mypy
Codehttps://github.com/python/mypy
Issues2.7k (2.7k)https://github.com/python/mypy/issues
Pull requests546 (546)https://github.com/python/mypy/pulls
Actionshttps://github.com/python/mypy/actions
Projectshttps://github.com/python/mypy/projects
Wikihttps://github.com/python/mypy/wiki
Security and qualityhttps://github.com/python/mypy/security
Insightshttps://github.com/python/mypy/insights
https://github.com/python/mypy
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/10007
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/10007
#17495https://github.com/python/mypy/pull/17495
dmypy crash with “Invalid type comment or annotation”https://github.com/python/mypy/issues/10007#top
#17495https://github.com/python/mypy/pull/17495
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
topic-daemondmypyhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-daemon%22
topic-typed-dicthttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-typed-dict%22
https://github.com/andrewdotn
andrewdotnhttps://github.com/andrewdotn
on Feb 1, 2021https://github.com/python/mypy/issues/10007#issue-798792423
andrewdotnhttps://github.com/andrewdotn
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
on Feb 1, 2021https://github.com/python/mypy/issues/10007#event-4276426759
AlexWaygoodhttps://github.com/AlexWaygood
topic-typed-dicthttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-typed-dict%22
topic-daemondmypyhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-daemon%22
on Mar 26, 2022https://github.com/python/mypy/issues/10007#event-6311420090
Michael0x2ahttps://github.com/Michael0x2a
on Sep 26, 2022https://github.com/python/mypy/issues/10007#event-7454372669
Stop TypedDictAnalyzer from leaking synthetic typeshttps://github.com/Michael0x2a/mypy/commit/169098452cff7036270ccc34ac1d426b76e16a5b
https://docs.github.com/articles/closing-issues-via-commit-messages
1690984https://github.com/Michael0x2a/mypy/commit/169098452cff7036270ccc34ac1d426b76e16a5b
Stop TypedDictAnalyzer from leaking synthetic typeshttps://github.com/Michael0x2a/mypy/commit/2451c0c61b044a2c64423d13433b7fb2d918534c
https://docs.github.com/articles/closing-issues-via-commit-messages
2451c0chttps://github.com/Michael0x2a/mypy/commit/2451c0c61b044a2c64423d13433b7fb2d918534c
Michael0x2ahttps://github.com/Michael0x2a
on Oct 23, 2022https://github.com/python/mypy/issues/10007#event-7649033769
Stop TypedDictAnalyzer from leaking synthetic typeshttps://github.com/Michael0x2a/mypy/commit/ef4d492659941a02805caed5f984e238e42003ae
https://docs.github.com/articles/closing-issues-via-commit-messages
ef4d492https://github.com/Michael0x2a/mypy/commit/ef4d492659941a02805caed5f984e238e42003ae
Fix crash with malformed TypedDicts and disllow-any-exprhttps://github.com/Michael0x2a/mypy/commit/67ba6f2a3aba1a2f7a8aa62a2049a34baf5b5eb2
https://docs.github.com/articles/closing-issues-via-commit-messages
67ba6f2https://github.com/Michael0x2a/mypy/commit/67ba6f2a3aba1a2f7a8aa62a2049a34baf5b5eb2
JukkaLhttps://github.com/JukkaL
on Oct 31, 2022https://github.com/python/mypy/issues/10007#event-7704825695
Fix crash with malformed TypedDicts and disllow-any-expr (#13963)https://github.com/python/mypy/commit/7569d88d0d650be73070c2536ddc3746d61237dd
#13963https://github.com/python/mypy/pull/13963
7569d88https://github.com/python/mypy/commit/7569d88d0d650be73070c2536ddc3746d61237dd
ilevkivskyihttps://github.com/ilevkivskyi
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#17495https://github.com/python/mypy/pull/17495
on Jul 6, 2024https://github.com/python/mypy/issues/10007#event-13412396758
ilevkivskyihttps://github.com/ilevkivskyi
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
e5b3b56https://github.com/python/mypy/commit/e5b3b563ea3f6d1f83d0fe3552965c8b05ea4c3d
on Jul 6, 2024https://github.com/python/mypy/issues/10007#event-13412396759
ilevkivskyihttps://github.com/ilevkivskyi
on Jul 6, 2024https://github.com/python/mypy/issues/10007#event-13412469513
Fix daemon crash on invalid type in TypedDict (python#17495)https://github.com/ilevkivskyi/mypy/commit/e5b3b563ea3f6d1f83d0fe3552965c8b05ea4c3d
python#17495https://github.com/python/mypy/pull/17495
e5b3b56https://github.com/ilevkivskyi/mypy/commit/e5b3b563ea3f6d1f83d0fe3552965c8b05ea4c3d
JukkaLhttps://github.com/JukkaL
on Jul 18, 2024https://github.com/python/mypy/issues/10007#event-13553685636
Fix daemon crash on invalid type in TypedDict (#17495)https://github.com/python/mypy/commit/2563da0c721a89725bfd009da12dd6378554bfc6
#17495https://github.com/python/mypy/pull/17495
2563da0https://github.com/python/mypy/commit/2563da0c721a89725bfd009da12dd6378554bfc6
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/10007
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/10007
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
topic-daemondmypyhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-daemon%22
topic-typed-dicthttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-typed-dict%22
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.