{
  "id": "python/aiohttp-invalid-url-with-scheme",
  "signature": "aiohttp.client_exceptions.InvalidURL: URL should be absolute",
  "signature_zh": "aiohttp.client_exceptions.InvalidURL: URL 应为绝对地址",
  "regex": "aiohttp\\.client_exceptions\\.InvalidURL:\\ URL\\ should\\ be\\ absolute",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "aiohttp requires fully qualified URLs including scheme and host; relative paths or strings missing http(s):// are rejected.",
  "root_cause_type": "generic",
  "root_cause_zh": "aiohttp 要求完全限定的 URL，必须包含协议和主机；相对路径或缺少 http(s):// 的字符串会被拒绝。",
  "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"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "base_url only affects redirects and links; session.get('/path') still raises InvalidURL.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Encoding does not add the missing scheme/host; the URL remains relative.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Use urllib.parse.urljoin to build an absolute URL:\n\nfrom urllib.parse import urljoin\nurl = urljoin('https://api.example.com', '/v1/users')\nasync with session.get(url) as resp:\n    ...",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Store full URLs in your config and validate at startup:\n\nassert url.startswith(('http://', 'https://')), f'bad url: {url}'",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-11",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}