ModuleNotFoundError: No module named 'imp' while installing subunit 1.4.0 using Conan with Python 3.12

Bug #2052948 reported by vital
6
This bug affects 1 person
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 `ModuleNotFoundError: No module named 'imp'`

Tail of the log:
```
...
libtool: install: chmod 644 ~/.conan/data/subunit/1.4.0/_/_/package/095274926d7784555b5378b8638d408c0c4d0378//lib/libcppunit_subunit.a
Traceback (most recent call last):
  File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'imp'
libtool: install: ranlib ~/.conan/data/subunit/1.4.0/_/_/package/095274926d7784555b5378b8638d408c0c4d0378//lib/libcppunit_subunit.a
make[1]: *** [Makefile:957: install-pkgpythonPYTHON] Error 1
make[1]: *** Waiting for unfinished jobs....
libtool: warning: remember to run 'libtool --finish //lib'
make[1]: Leaving directory '~/.conan/data/subunit/1.4.0/_/_/build/095274926d7784555b5378b8638d408c0c4d0378/src'
make: *** [Makefile:1447: install-am] Error 2
ERROR: subunit/1.4.0: Error in package() method, line 147
 autotools.install()
 ConanException: Error 2 while executing make install 'INSTALLARCHLIB=~/.conan/data/subunit/1.4.0/_/_/package/095274926d7784555b5378b8638d408c0c4d0378/lib' 'INSTALLSITEARCH=~/.conan/data/subunit/1.4.0/_/_/build/095274926d7784555b5378b8638d408c0c4d0378/build-release/archlib' 'INSTALLVENDORARCH=~/.conan/data/subunit/1.4.0/_/_/build/095274926d7784555b5378b8638d408c0c4d0378/build-release/archlib' 'INSTALLSITEBIN=~/.conan/data/subunit/1.4.0/_/_/package/095274926d7784555b5378b8638d408c0c4d0378/bin' 'INSTALLSITESCRIPT=~/.conan/data/subunit/1.4.0/_/_/package/095274926d7784555b5378b8638d408c0c4d0378/bin' 'INSTALLSITEMAN1DIR=~/.conan/data/subunit/1.4.0/_/_/build/095274926d7784555b5378b8638d408c0c4d0378/build-release/share/man/man1' 'INSTALLSITEMAN3DIR=~/.conan/data/subunit/1.4.0/_/_/build/095274926d7784555b5378b8638d408c0c4d0378/build-release/share/man/man3' DESTDIR=~/.conan/data/subunit/1.4.0/_/_/package/095274926d7784555b5378b8638d408c0c4d0378 -j16
```

# 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
```

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.