{
  "id": "python/aiohttp-toomanyredirects",
  "signature": "aiohttp.client_exceptions.TooManyRedirects: 0, message='Too many redirects', url=URL('https://example.com/')",
  "signature_zh": "aiohttp.client_exceptions.TooManyRedirects: 重定向次数过多",
  "regex": "aiohttp\\.client_exceptions\\.TooManyRedirects:\\ 0,\\ message='Too\\ many\\ redirects',\\ url=URL\\('https://example\\.com/'\\)",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The server returns a redirect loop (or more than max_redirects hops), typically due to HTTP-to-HTTPS misconfiguration or cookie/session requirements.",
  "root_cause_type": "generic",
  "root_cause_zh": "服务器返回重定向循环（或超过 max_redirects 跳数），通常由 HTTP 到 HTTPS 配置错误或 cookie/会话要求引起。",
  "versions": [
    {
      "version": "3.9+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "A true redirect loop never terminates; raising the limit only delays the failure and wastes requests.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "You then receive the 3xx response body instead of the target content, so the fetch still fails functionally.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.88,
      "how": "async with session.get(url, allow_redirects=False) as r:\n    print(r.status, r.headers.get('Location'))\n# follow manually and correct the base URL or auth cookie",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.75,
      "how": "session.cookie_jar.update_cookies({'session': token})\nasync with session.get(url) as r:\n    ...",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-09-02",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}