python-wcmatch not compatible to python3.12
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-wcmatch (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Mantic |
Won't Fix
|
Undecided
|
Unassigned | ||
Noble |
Fix Released
|
Undecided
|
Christian Ehrhardt |
Bug Description
[ Impact ]
* The code in wcmatch uses inner details of libraries hidden in python 3.12
* That breaks several use cases like ansible-lint and many self tests
[racb] ansible-lint doesn't work at all. Calling it with no arguments, calling it with --help, and calling it with --version all fail with the same stack trace.
[ Test Plan ]
1. For the original report, run ansible-lint
- without arguments you expect it to fail to load any file (that is ok, a total breakage failing to load wcmatch is not)
- with --help you want to see the help to be shown
- One can run ansible yaml file, with ansible-lint <file>, here are two one can use for that
a) With mistakes (1x fqcn[action-core] 1x yaml[truthy])
Result is
...
fqcn[action-core]: Use FQCN for builtin module actions (apt).
yaml[truthy]: Truthy value should be one of [false, true]
...
$ cat test.yaml
- name: Install apache2
hosts: servers
tasks:
- name: Ensure apache2 is installed
apt:
name: apache2
state: present
become: yes
b) A file that makes lint happy, result is
Passed: 0 failure(s), 0 warning(s) on 1 files. Last profile that met the validation criteria was 'production'.
$ cat test2.yaml
- name: Install apache2
hosts: servers
tasks:
- name: Ensure apache2 is installed
ansible.
name: apache2
state: present
become: true
2. For a wider coverage I recommend running the full self-tests
$ apt install dpkg-dev
# add deb-src to entries in /etc/apt/
$ apt update
$ apt source python-wcmatch
$ cd python-wcmatch-8.*
$ pytestdetailed instructions how to reproduce the bug
[ Where problems could occur ]
* wcmatch has multiple subelements, only pathlib use cases got changed
* There are untested changes to the windows code paths, but even WSL will run
the linux paths, so that should be a no-op
[ Other Info ]
* while in universe, this is just an easy fix and an oversight in
the python transition hence I think we should fix it
---
original report
Running ansible-lint in Ubuntu 24.04 on my role ends up with a stack trace:
Traceback (most recent call last):
File "/usr/bin/
from ansiblelint.
File "/usr/lib/
from ansiblelint import cli
File "/usr/lib/
from ansiblelint.
File "/usr/lib/
import wcmatch.pathlib
File "/usr/lib/
class PurePosixPath(
File "/usr/lib/
_flavour = pathlib.
AttributeError: module 'pathlib' has no attribute '_posix_flavour'
This is due to python3-
I think the following portion of changes can be added to library package for Noble release:
https:/
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://
500 http://
100 /var/lib/
python3-wcmatch:
Installed: 8.4-2
Candidate: 8.4-2
Version table:
*** 8.4-2 500
500 http://
500 http://
100 /var/lib/
Related branches
- git-ubuntu bot: Approve
- Robie Basak: Approve
- Canonical Server Reporter: Pending requested
-
Diff: 156 lines (+124/-1)4 files modifieddebian/changelog (+7/-0)
debian/control (+2/-1)
debian/patches/lp-2060649-support-Python-3.12.patch (+114/-0)
debian/patches/series (+1/-0)
tags: | added: noble |
Changed in python-wcmatch (Ubuntu): | |
assignee: | nobody → Christian Ehrhardt (paelzer) |
tags: | added: server-todo |
Changed in python-wcmatch (Ubuntu): | |
status: | Confirmed → Fix Released |
Changed in python-wcmatch (Ubuntu Noble): | |
assignee: | nobody → Christian Ehrhardt (paelzer) |
Changed in python-wcmatch (Ubuntu): | |
assignee: | Christian Ehrhardt (paelzer) → nobody |
Changed in python-wcmatch (Ubuntu Noble): | |
status: | New → Confirmed |
status: | Confirmed → Triaged |
description: | updated |
Changed in python-wcmatch (Ubuntu Noble): | |
status: | Triaged → In Progress |
Changed in python-wcmatch (Ubuntu Mantic): | |
status: | New → Won't Fix |
The Python compatibility is actually fixed in the upstream wcmatch package: /github. com/facelessuse r/wcmatch/ releases/ tag/8.5
https:/
(Update: Sorry - I did not see that this already got reported.)