[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dh_python3 sets shebang to Python 2 -- is this a bug?



I have an issue with a package build, and I'm not sure whether this is a
bug in dh-python, or whether I'm just misunderstanding something.


A package that had recently been converted from Python 2 to Python3 was
still generating dependencies for Python 2, see #936924.

Frederic-Emmanuel Picca correctly pointed me to the source of this
issue, it was an unversioned shebang in some scripts installed into
/usr/bin.

Here's the thing that puzzles me: dh_python3 identifies the unversioned
shebang,

  | I: dh_python3 tools:114: replacing shebang in debian/libsvm-tools/usr/bin/svm-grid
  | I: dh_python3 tools:114: replacing shebang in debian/libsvm-tools/usr/bin/svm-subset
  | I: dh_python3 tools:114: replacing shebang in debian/libsvm-tools/usr/bin/svm-checkdata
  | I: dh_python3 tools:114: replacing shebang in debian/libsvm-tools/usr/bin/svm-easy

but it replaces the shebang with the Python *2* versioned one.

A Python 3 helper setting /usr/bin/python2 looks odd to me, but I have
no in-depth knowledge of dh-python's design, or the corner cases it
might need to address.

Is there a use case where dh_python3 (not dh_python2) doing this can
make sense? Or can this be considered a bug?

Furthermore, the package does not list any Python 2 build dependencies,
and all binary package dependencies are generated by the
${python3:Depends} substvar. Could this perhaps be worth an "if the
package does not have Python 2 dependencies, a Python 2 shebang is a
bug" lintian check?


Christian


Reply to: