Python 3.10 raises ModuleNotFoundError in cattrs/_compat.py
envgap__python-attrs__cattrs-369
01 / FAILURE SIGNATURE
As reported upstream
ModuleNotFoundError: No module named 'typing_extensions'```
Not scored yet.
- The failure reproduces in a clean container and the known fix makes the project run; it has not been scored yet.
02 / ENVIRONMENT RECIPE
- Base commit
00932450fb27d8c6a53697244ae033b13916489b- Manifest
pyproject.toml- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
python-attrs/cattrs #369 · read the original issue
* cattrs version: 23.1.0
* Python version: 3.10.4
* Operating System: linux
### Description
In python 3.10, the import of cattrs/_compat is throwing a ModuleNotFoundError.
### What I Did
An automated pipeline we are using started throwing a ModuleNotFoundError today. This appears to be related to #364, where the import is not catching the correct exceptions for importing typing_extensions.
```
Traceback (most recent call last):
File "/builddir/.venv/bin/REDACTED", line 5, in <module>
from REDACTED import main
File "/builddir/.venv/lib/python3.10/site-packages/REDACTED/__init__.py", line 4, in <module>
from requests_cache import CachedSession, DO_NOT_CACHE
File "/builddir/.venv/lib/python3.10/site-packages/requests_cache/__init__.py", line 7, in <module>
from .backends import *
File "/builddir/.venv/lib/python3.10/site-packages/requests_cache/backends/__init__.py", line 7, in <module>
from .base import BaseCache, BaseStorage, DictStorage
File "/builddir/.venv/lib/python3.10/site-packages/requests_cache/backends/base.py", line 22, in <module>
from ..serializers import SerializerType, init_serializer
File "/builddir/.venv/lib/python3.10/site-packages/requests_cache/serializers/__init__.py", line 24, in <module>
from .cattrs import CattrStage
File "/builddir/.venv/lib/python3.10/site-packages/requests_cache/serializers/cattrs.py", line 19, in <module>
from cattr import Converter
File "/builddir/.venv/lib/python3.10/site-packages/cattr/__init__.py", line 1, in <module>
from .converters import BaseConverter, Converter, GenConverter, UnstructureStrategy
File "/builddir/.venv/lib/python3.10/site-packages/cattr/converters.py", line 1, in <module>
from cattrs.converters import (
File "/builddir/.venv/lib/python3.10/site-packages/cattrs/__init__.py", line 1, in <module>
from .converters import BaseConverter, Converter, GenConverter, UnstructureStrategy
File "/builddir/.venv/lib/python3.10/site-packages/cattrs/converters.py", line 26, in <module>
from ._compat import (
File "/builddir/.venv/lib/python3.10/site-packages/cattrs/_compat.py", line 372, in <module>
from typing_extensions import NotRequired, Required
ModuleNotFoundError: No module named 'typing_extensions'```
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]