Title: INTERNAL ERROR - mypy/nodes.py - TypeError: 'NoneType' object is not iterable · Issue #3776 · python/mypy · GitHub
Open Graph Title: INTERNAL ERROR - mypy/nodes.py - TypeError: 'NoneType' object is not iterable · Issue #3776 · python/mypy
X Title: INTERNAL ERROR - mypy/nodes.py - TypeError: 'NoneType' object is not iterable · Issue #3776 · python/mypy
Description: Using 0.521 Traceback obs/sentry.py:52: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521 Traceback (most recent call last): File "/Users/daenyth/Curata/observer/.tox/mypy/bin/mypy", lin...
Open Graph Description: Using 0.521 Traceback obs/sentry.py:52: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521 Traceback (most recent call last): File "/Users/daenyth/...
X Description: Using 0.521 Traceback obs/sentry.py:52: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521 Traceback (most recent call last): File "/Users/dae...
Opengraph URL: https://github.com/python/mypy/issues/3776
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"INTERNAL ERROR - mypy/nodes.py - TypeError: 'NoneType' object is not iterable","articleBody":"Using 0.521\r\n\r\n\r\n\u003cdetails>\u003csummary>Traceback\u003c/summary>\r\n\r\n```\r\nobs/sentry.py:52: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521\r\nTraceback (most recent call last):\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/bin/mypy\", line 11, in \u003cmodule>\r\n sys.exit(console_entry())\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/__main__.py\", line 7, in console_entry\r\n main(None)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/main.py\", line 50, in main\r\n res = type_check_only(sources, bin_dir, options)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/main.py\", line 97, in type_check_only\r\n options=options)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/build.py\", line 196, in build\r\n graph = dispatch(sources, manager)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/build.py\", line 1801, in dispatch\r\n process_graph(graph, manager)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/build.py\", line 2044, in process_graph\r\n process_stale_scc(graph, scc, manager)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/build.py\", line 2147, in process_stale_scc\r\n graph[id].type_check_first_pass()\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/build.py\", line 1716, in type_check_first_pass\r\n self.type_checker.check_first_pass()\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checker.py\", line 185, in check_first_pass\r\n self.accept(d)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checker.py\", line 273, in accept\r\n stmt.accept(self)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/nodes.py\", line 565, in accept\r\n return visitor.visit_func_def(self)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checker.py\", line 519, in visit_func_def\r\n self.check_func_item(defn, name=defn.name())\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checker.py\", line 578, in check_func_item\r\n self.check_func_def(defn, typ, name)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checker.py\", line 738, in check_func_def\r\n self.accept(item.body)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checker.py\", line 273, in accept\r\n stmt.accept(self)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/nodes.py\", line 815, in accept\r\n return visitor.visit_block(self)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checker.py\", line 1202, in visit_block\r\n self.accept(s)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checker.py\", line 273, in accept\r\n stmt.accept(self)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/nodes.py\", line 859, in accept\r\n return visitor.visit_assignment_stmt(self)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checker.py\", line 1209, in visit_assignment_stmt\r\n self.check_assignment(s.lvalues[-1], s.rvalue, s.type is None, s.new_syntax)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checker.py\", line 1300, in check_assignment\r\n self.infer_variable_type(inferred, lvalue, self.expr_checker.accept(rvalue),\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checkexpr.py\", line 2213, in accept\r\n typ = node.accept(self)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/nodes.py\", line 1307, in accept\r\n return visitor.visit_call_expr(self)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checkexpr.py\", line 247, in visit_call_expr\r\n ret_type = self.check_call_expr_with_callee_type(callee_type, e, fullname, object_type)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checkexpr.py\", line 459, in check_call_expr_with_callee_type\r\n object_type=object_type)[0]\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checkexpr.py\", line 561, in check_call\r\n self.infer_arg_types_in_context(None, args)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checkexpr.py\", line 648, in infer_arg_types_in_context\r\n arg_type = self.accept(arg, ctx)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checkexpr.py\", line 2213, in accept\r\n typ = node.accept(self)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/nodes.py\", line 1260, in accept\r\n return visitor.visit_member_expr(self)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checkexpr.py\", line 1150, in visit_member_expr\r\n result = self.analyze_ordinary_member_access(e, False)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checkexpr.py\", line 1165, in analyze_ordinary_member_access\r\n original_type=original_type, chk=self.chk)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checkmember.py\", line 101, in analyze_member_access\r\n original_type=original_type, chk=chk)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checkmember.py\", line 223, in analyze_member_var_access\r\n v = lookup_member_var_or_accessor(info, name, is_lvalue)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/checkmember.py\", line 364, in lookup_member_var_or_accessor\r\n node = info.get(name)\r\n File \"/Users/daenyth/Curata/observer/.tox/mypy/lib/python3.6/site-packages/mypy/nodes.py\", line 2042, in get\r\n for cls in self.mro:\r\nTypeError: 'NoneType' object is not iterable\r\nobs/sentry.py:52: note: use --pdb to drop into pdb\r\n```\r\n\r\n\u003c/details>\r\n\r\n\r\nLine 52 is `dsn=cfg.dsn,`\r\n\r\nSentryConfig is a typing.NamedTuple class.\r\nobs.config imports `no_sentry`, which is why I use the `if TYPE_CHECKING` and forward reference\r\n\r\n\u003cdetails>\u003csummary>File triggering error\u003c/summary>\r\n\r\n```\r\n\"\"\"\r\nUtilities for interacting with Sentry (sentry.io)\r\n\"\"\"\r\nfrom typing import TypeVar, Dict, Any, Optional, TYPE_CHECKING\r\n\r\nimport raven # type: ignore\r\nfrom raven.processors import Processor # type: ignore\r\nfrom raven.utils import varmap # type: ignore\r\n\r\nif TYPE_CHECKING:\r\n # Avoid circular import\r\n from .config import SentryConfig\r\n\r\nA = TypeVar('A')\r\n\r\n# Sentinel value\r\n_no_sentry = object()\r\n\r\n\r\ndef no_sentry(obj: A) -> A:\r\n \"\"\"\r\n Decorates an object that should not be included in sentry's stack trace locals\r\n \"\"\"\r\n obj._no_sentry = _no_sentry # type: ignore\r\n return obj\r\n\r\n\r\nclass GenericLocalProcessor(Processor): # type: ignore\r\n \"\"\"\r\n Can be subclassed by overriding `should_remove`, which will get each local name and value in traces\r\n \"\"\"\r\n\r\n def should_remove(self, name: str, value: object) -> bool:\r\n raise NotImplementedError\r\n\r\n def filter_stacktrace(self, data: Dict[str, Any]) -> None:\r\n for frame in data.get('frames', []):\r\n if 'vars' not in frame:\r\n continue\r\n frame['vars'] = varmap(lambda name, var: \"REDACTED\" if self.should_remove(name, var) else var,\r\n frame['vars'])\r\n\r\n\r\nclass RemoveNoSentryProcessor(GenericLocalProcessor):\r\n def should_remove(self, name: str, value: object) -> bool:\r\n return hasattr(value, '_no_sentry')\r\n\r\n\r\n# Forward reference arg here to avoid circular import\r\ndef get_sentry_client(cfg: 'SentryConfig', sentry_tags: Optional[Dict[str, str]]) -> raven.Client:\r\n client = raven.Client(\r\n dsn=cfg.dsn,\r\n environment=cfg.environment,\r\n include_paths=['obs'],\r\n release=raven.fetch_package_version('Observer'),\r\n tags=sentry_tags or {},\r\n processors=['raven.processors.SanitizePasswordsProcessor', 'obs.sentry.RemoveNoSentryProcessor'])\r\n return client\r\n```","author":{"url":"https://github.com/Daenyth","@type":"Person","name":"Daenyth"},"datePublished":"2017-07-28T18:31:31Z","url":"https://github.com/python/mypy/issues/3776"}
| 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:a3aeaf8b-e3f5-bba7-8307-5267e74b4200 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 82BC:3AE712:EC01B2:13D38D5:6B005A31 |
| html-safe-nonce | 0f9e03839224261fb4d066b419828689e0d89bf2ca2cd99abaf9c012681a31a2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkJDOjNBRTcxMjpFQzAxQjI6MTNEMzhENTo2QjAwNUEzMSIsInZpc2l0b3JfaWQiOiIzMjEyMjc0Njk3NTI1ODExNzYxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4ed60c4c7173c03ce85e468f34c5223850b3a91091fa052a2365e49ac8175995 |
| hovercard-subject-tag | issue:246425492 |
| 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/3776/issue_layout |
| twitter:image | https://opengraph.githubassets.com/671d85375c717872948e0bf9ba06cdb6114974e64e7ffa6de066b99a1e7608dd/python/mypy/issues/3776 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/671d85375c717872948e0bf9ba06cdb6114974e64e7ffa6de066b99a1e7608dd/python/mypy/issues/3776 |
| og:image:alt | Using 0.521 Traceback obs/sentry.py:52: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521 Traceback (most recent call last): File "/Users/daenyth/... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Daenyth |
| 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