{
  "id": "python/pytest-cache-provider-error",
  "signature": "pytest-cache: failed to write cache file /path/.pytest_cache/v/cache/lastfailed: [Errno 13] Permission denied",
  "signature_zh": "pytest-cache：无法写入缓存文件：权限被拒绝",
  "regex": "pytest\\-cache:\\ failed\\ to\\ write\\ cache\\ file\\ /path/\\.pytest_cache/v/cache/lastfailed:\\ \\[Errno\\ 13\\]\\ Permission\\ denied",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "pytest 缓存目录没有写入权限，通常因为运行用户或目录权限设置。",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest 缓存目录没有写入权限，通常因为运行用户或目录权限设置。",
  "versions": [
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "删除 .pytest_cache",
      "why_fails": "尝试删除缓存目录但权限问题依然存在",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "chmod 777",
      "why_fails": "尝试修改目录所有者但需要 root 权限",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "修改目录权限",
      "success_rate": 0.9,
      "how": "chmod -R u+w .pytest_cache",
      "condition": "",
      "sources": []
    },
    {
      "action": "禁用缓存插件",
      "success_rate": 0.85,
      "how": "pytest -p no:cacheprovider",
      "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": "2025-11-02",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}