{
  "id": "python/django-cache-key-error",
  "signature": "django.core.cache.backends.base.InvalidCacheKey: Cache key contains characters that will cause errors if used with memcached: \"my key with spaces\"",
  "signature_zh": "缓存键错误：缓存键包含与memcached一起使用会导致错误的字符：\"my key with spaces\"",
  "regex": "django\\.core\\.cache\\.backends\\.base\\.InvalidCacheKey:\\ Cache\\ key\\ contains\\ characters\\ that\\ will\\ cause\\ errors\\ if\\ used\\ with\\ memcached:\\ \"my\\ key\\ with\\ spaces\"",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "缓存键包含空格或特殊字符，memcached不支持",
  "root_cause_type": "generic",
  "root_cause_zh": "Django缓存键中使用了空格等非法字符，导致后端缓存服务拒绝",
  "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.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "长度不是问题，非法字符才是",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "from django.core.cache import make_key; safe_key = make_key('my key with spaces')",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "key = key.replace(' ', '_')",
      "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.81,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-12-11",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}