{
  "id": "python/oserror-errno-2-no-such-file",
  "signature": "OSError: [Errno 2] No such file or directory: 'test_data.csv'",
  "signature_zh": "操作系统错误：[Errno 2] 没有那个文件或目录：'test_data.csv'",
  "regex": "OSError:\\ \\[Errno\\ 2\\]\\ No\\ such\\ file\\ or\\ directory:\\ 'test_data\\.csv'",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "A test tries to open a file that does not exist in the current working directory or specified path.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试尝试打开当前工作目录或指定路径中不存在的文件。",
  "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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Creating an empty file with same name",
      "why_fails": "Empty file may cause parsing errors or incorrect test results.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Hardcoding absolute path",
      "why_fails": "Absolute paths break portability across different environments.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use relative path with proper test directory",
      "success_rate": 0.95,
      "how": "import os; filepath = os.path.join(os.path.dirname(__file__), 'test_data.csv')",
      "condition": "",
      "sources": []
    },
    {
      "action": "Create test data using pytest fixture",
      "success_rate": 0.9,
      "how": "@pytest.fixture\ndef test_data():\n    return {'key': 'value'}",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-05-02",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}