Package: dh-python Version: 5.20220403 Severity: normal Dear Maintainer,
We've originally hit this bug in the version of dh-python in Ubuntu 18.06, but looking at the code currently in unstable, this still applies. The code that handles DEB_PYTHON3_SUPPORTED wants multiple versions to be separated with commas: https://sources.debian.org/src/dh-python/5.20220403/dhpython/_defaults.py/#L61 When using dh_python --buildsystem=pybuild, pybuild is called with the -p argument with the value of DEB_PYTHON3_SUPPORTED as is: https://sources.debian.org/src/dh-python/5.20220403/dh/pybuild.pm/#L214 where py3vers comes from https://sources.debian.org/src/dh-python/5.20220403/dh/pybuild.pm/#L47 So, when you use DEB_PYTHON3_SUPPORTED=3.6,3.7 to build with support for both 3.6 and 3.7, pybuild is called with `-p 3.6,3.7`... which it doesn't handle as meaning you want both versions: here `3.6,3.7` would be taken as one version: https://sources.debian.org/src/dh-python/5.20220403/pybuild/#L566 which is then handled here: https://sources.debian.org/src/dh-python/5.20220403/pybuild/#L174 which uses this parser: https://sources.debian.org/src/dh-python/5.20220403/dhpython/version.py/#L60 which uses this regexp: https://sources.debian.org/src/dh-python/5.20220403/dhpython/version.py/#L29 which stops at the comma and discard everything else. pybuild does handle `-p "3.6 3.7"` as meaning both versions, but then dh_python considers it as major version 3, minor version "6 3", and throws an exception. Mike