# CacheError: 从 .pytest_cache/v/cache/nodeids 读取缓存失败: [Errno 5] 输入/输出错误

- **ID:** `python/pytest-cache-dir-corruption`
- **领域:** python
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

pytest 缓存目录损坏，通常是由于之前的测试运行被中断或磁盘问题。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |
| 3.12 | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   Delete the .pytest_cache directory manually: `rm -rf .pytest_cache`
   ```
2. **** (90% 成功率)
   ```
   Run pytest with --cache-clear and ensure proper disk space and permissions.
   ```

## 无效尝试

- **** — This clears the cache but does not fix the underlying disk or permission issue that caused corruption. (50% 失败率)
- **** — This is error-prone and may introduce further corruption if the file format is not understood. (80% 失败率)
