[Forward compatibility] Custom module finders must implement an exec_module()
method
#72952
Labels
affects_2.11
bug
This issue/PR relates to a bug.
files
Files category
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
traceback
This issue/PR includes a traceback.
Projects
SUMMARY
Loader.load_module()
has been deprecated since Python 3.4 (https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.load_module) and the development branch of CPython (aka 3.10-dev) has started to actually raise anImportWarning
. Any system that sets thefilterwarnings
feature toerror
will fail loudly.I've first encountered it coming from
pkg_resources
(pypa/setuptools#2481) and then, I've learned thatsix
has the same problem (benjaminp/six#341). And since we vendorsix
, we'll encounter it sooner or later.Besides, our custom collections loader import machinery also doesn't implement
exec_module()
which generates a similar warning as well.For context, the original deprecation warning was introduced in CPython via https://bugs.python.org/issue26131 and python/cpython#23469.
ISSUE TYPE
COMPONENT NAME
collection loader and the vendored six copy
ANSIBLE VERSION
CONFIGURATION
N/A
OS / ENVIRONMENT
Python 3.10+
STEPS TO REPRODUCE
You should only need Python 3.10-dev (you can get one via pyenv or dnf on Fedora, although I'm not sure if the latter has it up-to-date right now — the relevant PR got merged a week ago and started failing some of my GHA CIs just yesterday) and Ansible (I checked on devel but other supported versions are expected to have the same problem).
EXPECTED RESULTS
No warning raised.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: