{
  "id": "python/unittest-mock-patch-error",
  "signature": "AttributeError: <module 'module1' from '/path/module1.py'> does not have the attribute 'func'",
  "signature_zh": "属性错误：模块 module1 中没有属性 'func'",
  "regex": "AttributeError:\\ <module\\ 'module1'\\ from\\ '/path/module1\\.py'>\\ does\\ not\\ have\\ the\\ attribute\\ 'func'",
  "domain": "python",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "使用 unittest.mock.patch 时，目标属性不存在或路径错误",
  "root_cause_type": "generic",
  "root_cause_zh": "使用 unittest.mock.patch 时，目标属性不存在或路径错误",
  "versions": [
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "属性可能确实存在但路径错误",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "如果目标错误，同样会失败",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "@patch('module1.func', return_value=42)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.7,
      "how": "@patch('module1.func', create=True)",
      "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": "2024-03-03",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}