← All tasks
pythontox-dev/platformdirs #122Not a task: already works

Release 2.6.1 fails on import on Python < 3.8 w/o typing extensions

envgap__tox-dev__platformdirs-122

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
79e262e22b2de0baefc750b0d7640b6b2d9973f5
Manifest
pyproject.toml
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

tox-dev/platformdirs #122 · read the original issue
If you import platformdirs on python < 3.8, it now fails with release 2.6.1 unless you have the typing-extensions package already installed.



I think the issue is this change in release 2.6.1: https://github.com/platformdirs/platformdirs/compare/2.6.0...2.6.1#diff-e6813e0402941ad4943c8261f1ecfe5e1f9ccd55cb009b996fd785f3637fc7c2



I would suggest it should be:

```

from typing import TYPE_CHECKING



if TYPE_CHECKING:

    if sys.version_info >= (3, 8):  # pragma: no cover (py38+)

        from typing import Literal

    else:  # pragma: no cover (py38+)

        from typing_extensions import Literal

```



Alternatively, typing_extensions should be added as a dependency
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]