Title: File shadowing with --follow-imports=skip can cause crashes in incremental and daemon mode · Issue #6935 · python/mypy · GitHub
Open Graph Title: File shadowing with --follow-imports=skip can cause crashes in incremental and daemon mode · Issue #6935 · python/mypy
X Title: File shadowing with --follow-imports=skip can cause crashes in incremental and daemon mode · Issue #6935 · python/mypy
Description: Imagine the following scenario: One uses --follow-imports=skip and then adds a file some_dir/some_file.py to the build. If there is a file in the some_dir called e.g. types.py that is not in the build, then this will cause actual typeshe...
Open Graph Description: Imagine the following scenario: One uses --follow-imports=skip and then adds a file some_dir/some_file.py to the build. If there is a file in the some_dir called e.g. types.py that is not in the bu...
X Description: Imagine the following scenario: One uses --follow-imports=skip and then adds a file some_dir/some_file.py to the build. If there is a file in the some_dir called e.g. types.py that is not in the bu...
Opengraph URL: https://github.com/python/mypy/issues/6935
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"File shadowing with --follow-imports=skip can cause crashes in incremental and daemon mode","articleBody":"Imagine the following scenario: One uses `--follow-imports=skip` and then adds a file `some_dir/some_file.py` to the build. If there is a file in the `some_dir` called e.g. `types.py` that is not in the build, then this will cause actual typeshed `types.pyi` being silently kicked out of the build.\r\n\r\nAlthough such behavior is IMO counterintuitive, it is technically correct (according to the current import resolution specs). The problem however is that this can cause crashes. I was not able to minimize the repros, but here are two tracebacks. One from the normal incremental mode:\r\n```\r\nTraceback (most recent call last):\r\n File \"/usr/lib/python3.5/runpy.py\", line 184, in _run_module_as_main\r\n \"__main__\", mod_spec)\r\n File \"mypy/main.py\", line 93, in main\r\n File \"mypy/build.py\", line 167, in build\r\n File \"mypy/build.py\", line 227, in _build\r\n File \"mypy/build.py\", line 2565, in dispatch\r\n File \"mypy/build.py\", line 2871, in process_graph\r\n File \"mypy/build.py\", line 2949, in process_fresh_modules\r\n File \"mypy/build.py\", line 1862, in fix_cross_refs\r\n File \"mypy/fixup.py\", line 25, in fixup_module\r\n File \"mypy/fixup.py\", line 90, in visit_symbol_table\r\n File \"mypy/nodes.py\", line 654, in accept__Node_glue\r\n File \"mypy/nodes.py\", line 655, in accept\r\n File \"mypy/fixup.py\", line 92, in visit_func_def__StatementVisitor_glue\r\n File \"mypy/fixup.py\", line 96, in visit_func_def\r\n File \"mypy/types.py\", line 959, in accept\r\n File \"mypy/fixup.py\", line 164, in visit_callable_type__TypeVisitor_glue\r\n File \"mypy/fixup.py\", line 170, in visit_callable_type\r\n File \"mypy/types.py\", line 650, in accept\r\n File \"mypy/fixup.py\", line 144, in visit_instance__TypeVisitor_glue\r\n File \"mypy/fixup.py\", line 157, in visit_instance\r\n File \"mypy/types.py\", line 1644, in accept\r\n File \"mypy/fixup.py\", line 226, in visit_union_type__TypeVisitor_glue\r\n File \"mypy/fixup.py\", line 229, in visit_union_type\r\n File \"mypy/types.py\", line 650, in accept\r\n File \"mypy/fixup.py\", line 144, in visit_instance__TypeVisitor_glue\r\n File \"mypy/fixup.py\", line 150, in visit_instance\r\n File \"mypy/fixup.py\", line 240, in lookup_qualified_typeinfo\r\n File \"mypy/fixup.py\", line 254, in lookup_qualified\r\n File \"mypy/fixup.py\", line 263, in lookup_qualified_stnode\r\n File \"mypy/lookup.py\", line 29, in lookup_fully_qualified\r\nAssertionError: Cannot find module for types.TracebackType\r\n```\r\nand another from the fine-grained incremental mode\r\n```\r\nTraceback (most recent call last):\r\n File \"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py\", line 193, in _run_module_as_main\r\n \"__main__\", mod_spec)\r\n File \"mypy/checkexpr.py\", line 3263, in accept\r\n File \"mypy/nodes.py\", line 1470, in accept\r\n File \"mypy/checkexpr.py\", line 1752, in visit_member_expr__ExpressionVisitor_glue\r\n File \"mypy/checkexpr.py\", line 1755, in visit_member_expr\r\n File \"mypy/checkexpr.py\", line 1763, in analyze_ordinary_member_access\r\n File \"mypy/checkexpr.py\", line 177, in analyze_ref_expr\r\n File \"mypy/checkmember.py\", line 783, in type_object_type\r\nValueError: \u003cTypeInfo logging.Formatter> is not in list\r\n```","author":{"url":"https://github.com/ilevkivskyi","@type":"Person","name":"ilevkivskyi"},"datePublished":"2019-06-04T19:01:15Z","url":"https://github.com/python/mypy/issues/6935"}
| 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:472ea575-6069-db7a-6371-f6adfc8ca652 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DAEA:182C25:4EBA0E:69F537:6B002FC4 |
| html-safe-nonce | 3c42c33a487c2e89ab2a14b00920654e040121610b094712e1aad486d7a409dc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQUVBOjE4MkMyNTo0RUJBMEU6NjlGNTM3OjZCMDAyRkM0IiwidmlzaXRvcl9pZCI6IjU1OTEyMjYwNzMxMTYzMjM3ODAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 977a26bd3e876042bb7e09e49fd36d7d5007538c218f06c5966a62479e6360bc |
| hovercard-subject-tag | issue:452157013 |
| 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/6935/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e88343157e5a9895ff6ec3d387354f284c261d782a1c7a7f1f2da2af6308d01c/python/mypy/issues/6935 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e88343157e5a9895ff6ec3d387354f284c261d782a1c7a7f1f2da2af6308d01c/python/mypy/issues/6935 |
| og:image:alt | Imagine the following scenario: One uses --follow-imports=skip and then adds a file some_dir/some_file.py to the build. If there is a file in the some_dir called e.g. types.py that is not in the bu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ilevkivskyi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width