{
  "id": "python/keyerror-key-not-found-in-dict",
  "signature": "KeyError: 'missing_key'",
  "signature_zh": "键错误：'missing_key'",
  "regex": "KeyError:\\ 'missing_key'",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A test tries to access a key in a dictionary that does not exist.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试尝试访问字典中不存在的键。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Using dict.get() without default",
      "why_fails": "Returns None, which may cause subsequent errors if None is not handled.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Catching KeyError silently",
      "why_fails": "Silent catch hides the missing key and may lead to incorrect test results.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use dict.get() with a default value",
      "success_rate": 0.95,
      "how": "value = my_dict.get('missing_key', 'default')",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check key existence before access",
      "success_rate": 0.9,
      "how": "if 'missing_key' in my_dict: value = my_dict['missing_key']",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-03-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}