{"action":"opened","issue":{"url":"https://api.github.com/repos/python/mypy/issues/6935","repository_url":"https://api.github.com/repos/python/mypy","labels_url":"https://api.github.com/repos/python/mypy/issues/6935/labels{/name}","comments_url":"https://api.github.com/repos/python/mypy/issues/6935/comments","events_url":"https://api.github.com/repos/python/mypy/issues/6935/events","html_url":"https://github.com/python/mypy/issues/6935","id":452157013,"node_id":"MDU6SXNzdWU0NTIxNTcwMTM=","number":6935,"title":"File shadowing with --follow-imports=skip can cause crashes in incremental and daemon mode","user":{"login":"ilevkivskyi","id":12005495,"node_id":"MDQ6VXNlcjEyMDA1NDk1","avatar_url":"https://avatars1.githubusercontent.com/u/12005495?v=4","gravatar_id":"","url":"https://api.github.com/users/ilevkivskyi","html_url":"https://github.com/ilevkivskyi","followers_url":"https://api.github.com/users/ilevkivskyi/followers","following_url":"https://api.github.com/users/ilevkivskyi/following{/other_user}","gists_url":"https://api.github.com/users/ilevkivskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/ilevkivskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilevkivskyi/subscriptions","organizations_url":"https://api.github.com/users/ilevkivskyi/orgs","repos_url":"https://api.github.com/users/ilevkivskyi/repos","events_url":"https://api.github.com/users/ilevkivskyi/events{/privacy}","received_events_url":"https://api.github.com/users/ilevkivskyi/received_events","type":"User","site_admin":false},"labels":[{"id":379446833,"node_id":"MDU6TGFiZWwzNzk0NDY4MzM=","url":"https://api.github.com/repos/python/mypy/labels/crash","name":"crash","color":"b60205","default":false},{"id":513232516,"node_id":"MDU6TGFiZWw1MTMyMzI1MTY=","url":"https://api.github.com/repos/python/mypy/labels/priority-0-high","name":"priority-0-high","color":"fbca04","default":false},{"id":783098167,"node_id":"MDU6TGFiZWw3ODMwOTgxNjc=","url":"https://api.github.com/repos/python/mypy/labels/topic-fine-grained-incremental","name":"topic-fine-grained-incremental","color":"d93f0b","default":false},{"id":354997184,"node_id":"MDU6TGFiZWwzNTQ5OTcxODQ=","url":"https://api.github.com/repos/python/mypy/labels/topic-incremental","name":"topic-incremental","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-06-04T19:01:15Z","updated_at":"2019-06-04T19:01:15Z","closed_at":null,"author_association":"COLLABORATOR","body":"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: <TypeInfo logging.Formatter> is not in list\r\n```"}}
{"actor":{"display_login":"ilevkivskyi"}}