ansible-lint crashes in 24.04

Bug #2060649 reported by Alexander Sitnik
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
python-wcmatch (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Running ansible-lint in Ubuntu 24.04 on my role ends up with a stack trace:

Traceback (most recent call last):
  File "/usr/bin/ansible-lint", line 5, in <module>
    from ansiblelint.__main__ import _run_cli_entrypoint
  File "/usr/lib/python3/dist-packages/ansiblelint/__main__.py", line 39, in <module>
    from ansiblelint import cli
  File "/usr/lib/python3/dist-packages/ansiblelint/cli.py", line 20, in <module>
    from ansiblelint.file_utils import (
  File "/usr/lib/python3/dist-packages/ansiblelint/file_utils.py", line 15, in <module>
    import wcmatch.pathlib
  File "/usr/lib/python3/dist-packages/wcmatch/pathlib.py", line 218, in <module>
    class PurePosixPath(PurePath):
  File "/usr/lib/python3/dist-packages/wcmatch/pathlib.py", line 221, in PurePosixPath
    _flavour = pathlib._posix_flavour # type: ignore[attr-defined]
               ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pathlib' has no attribute '_posix_flavour'

This is due to python3-wcmatch=8.4-2 being incompatible with python3.12. Upstream fixed this in the next version https://github.com/facelessuser/wcmatch/releases/tag/8.5

I think the following portion of changes can be added to library package for Noble release:
https://github.com/facelessuser/wcmatch/pull/203/files#diff-081b2096c270ab6b17a6c70f95ea07d24dd0d343522e135dbdeb609e59867186L83

Versions of installed packages:

ansible-lint:
  Installed: 6.17.2-1
  Candidate: 6.17.2-1
  Version table:
 *** 6.17.2-1 500
        500 http://ru.archive.ubuntu.com/ubuntu noble/universe amd64 Packages
        500 http://ru.archive.ubuntu.com/ubuntu noble/universe i386 Packages
        100 /var/lib/dpkg/status

python3-wcmatch:
  Installed: 8.4-2
  Candidate: 8.4-2
  Version table:
 *** 8.4-2 500
        500 http://ru.archive.ubuntu.com/ubuntu noble/universe amd64 Packages
        500 http://ru.archive.ubuntu.com/ubuntu noble/universe i386 Packages
        100 /var/lib/dpkg/status

Tags: noble
tags: added: noble
Revision history for this message
Matthias Lüscher (m-luescher) wrote (last edit ):

The Python compatibility is actually fixed in the upstream wcmatch package:
https://github.com/facelessuser/wcmatch/releases/tag/8.5

(Update: Sorry - I did not see that this already got reported.)

Revision history for this message
Alexander Sitnik (alex-sitnik) wrote :

Matthias, yes I know. I've mentioned this in bug report.

Is there any chance that newer version of python3-wcmatch will reach Noble release?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ansible-lint (Ubuntu):
status: New → Confirmed
Revision history for this message
Sorin Sbarnea (ssbarnea) wrote :

We are going to add https://github.com/ansible/ansible-lint/pull/4130 upstream to prevent accidental installation of incompatible dependencies. Feel free to switch to the newer version to avoid this issue.

Note that linter switched to CalVer, so don't be scared about the major version change (is not really breaking one).

There are no plans for backporting as we currently support only latest version (no maintenance branches).

Revision history for this message
Sorin Sbarnea (ssbarnea) wrote :

Basically the correct description for this bug is: "ubuntu 22.04 ships a broken python3-wcmatch" because it is known that the version shipped is incompatible with python 3.12, which happens to be the system python.

Once wcmatch is update to 8.5.0 or newer the linter will start working.

affects: ansible-lint (Ubuntu) → python-wcmatch (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.