ModuleNotFoundError: No module named 'imp' while installing subunit 1.4.0 using Conan with Python 3.12
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
subunit |
New
|
Undecided
|
Unassigned |
Bug Description
# Environment
Python 3.12 is required to reproduce the issue
# Steps to reproduce
```
python3 -m pip install conan==1.62
conan profile new --detect default
mkdir /tmp/subunit
cd /tmp/subunit
cat >conanfile.txt <<EOF
[requires]
subunit/1.4.0
[generators]
cmake
EOF
conan install --build -- .
```
## Expected result
Package is installed
## Actual result
`py-compile` tool fails with `ModuleNotFound
Tail of the log:
```
...
libtool: install: chmod 644 ~/.conan/
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundE
libtool: install: ranlib ~/.conan/
make[1]: *** [Makefile:957: install-
make[1]: *** Waiting for unfinished jobs....
libtool: warning: remember to run 'libtool --finish //lib'
make[1]: Leaving directory '~/.conan/
make: *** [Makefile:1447: install-am] Error 2
ERROR: subunit/1.4.0: Error in package() method, line 147
autotools.
ConanException: Error 2 while executing make install 'INSTALLARCHLIB
```
# Analysis
`py-compile` script from Automake contains the following lines which are incompatible with Python 3.12, because `imp` module is deprecated:
```
$PYTHON -c "
import sys, os, py_compile, imp
```