# error: error in 'egg_info' command: 'NoneType' object has no attribute 'get'

- **ID:** `python/pip-egg-info-metadata-generation-failed`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A malformed or partially missing setup.cfg/pyproject.toml section causes setuptools' metadata reader to receive None where a dict is expected during egg_info generation.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (85% success)
   ```
   Validate config: python -c "import configparser,sys; c=configparser.ConfigParser(); c.read('setup.cfg'); print(dict(c['metadata']))"
   ```
2. **** (90% success)
   ```
   Move metadata into pyproject.toml's [project] table and remove the conflicting setup.cfg section
   ```
3. **** (80% success)
   ```
   Run python setup.py egg_info -v to see the full traceback and locate the offending key
   ```

## Dead Ends

- **** — Isolation is not the cause; the malformed metadata file still breaks egg_info. (85% fail)
- **** — The stale directory is regenerated from the same malformed config, reproducing the error. (80% fail)
- **** — A newer setuptools may produce a clearer error but still cannot parse an invalid config. (70% fail)
