# OSError: [Errno 2] No such file or directory: 'test_data.csv'

- **ID:** `python/oserror-errno-2-no-such-file`
- **Domain:** python
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A test tries to open a file that does not exist in the current working directory or specified path.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |

## Workarounds

1. **Use relative path with proper test directory** (95% success)
   ```
   import os; filepath = os.path.join(os.path.dirname(__file__), 'test_data.csv')
   ```
2. **Create test data using pytest fixture** (90% success)
   ```
   @pytest.fixture
def test_data():
    return {'key': 'value'}
   ```

## Dead Ends

- **Creating an empty file with same name** — Empty file may cause parsing errors or incorrect test results. (70% fail)
- **Hardcoding absolute path** — Absolute paths break portability across different environments. (50% fail)
