{
  "id": "python/pytest-capture-io-error",
  "signature": "OSError: pytest: error while capturing stdout/stderr",
  "signature_zh": "操作系统错误：pytest：捕获stdout/stderr时出错",
  "regex": "OSError:\\ pytest:\\ error\\ while\\ capturing\\ stdout/stderr",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "pytest在捕获输出时遇到I/O错误，可能因为文件描述符耗尽或输出重定向问题。",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest在捕获输出时遇到I/O错误，可能因为文件描述符耗尽或输出重定向问题。",
  "versions": [
    {
      "version": "7.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "禁用捕获会丢失输出信息，且可能掩盖问题",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "ulimit修改可能不生效或影响系统",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.8,
      "how": "pytest --capture=sys",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "确保所有open()调用都使用with或close()",
      "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.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-11-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}