{
  "id": "python/flask-route-argument-type-error",
  "signature": "TypeError: view function takes 1 positional argument but 2 were given",
  "signature_zh": "类型错误：视图函数接受 1 个位置参数，但提供了 2 个",
  "regex": "TypeError:\\ view\\ function\\ takes\\ 1\\ positional\\ argument\\ but\\ 2\\ were\\ given",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "路由定义了 URL 变量，但视图函数参数数量不匹配。",
  "root_cause_type": "generic",
  "root_cause_zh": "路由定义了 URL 变量，但视图函数参数数量不匹配。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "默认参数不能解决参数数量不匹配的问题",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "虽然不报错，但会掩盖问题，导致逻辑错误",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 1.0,
      "how": "@app.route('/user/<int:user_id>')\ndef show_user(user_id):\n    return f'User {user_id}'",
      "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.9,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-11",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}