Bug 1210583

Summary: john: get rid of /usr/bin/python and /usr/bin/python2 as the script interpreter
Product: [openSUSE] openSUSE Distribution Reporter: Max Lin <mlin>
Component: OtherAssignee: Torsten Gruner <t.gruner>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: bwiedemann, mcepl
Version: Leap 15.5   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://github.com/openwall/john/pull/5309
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 1210594    

Description Max Lin 2023-04-18 13:12:36 UTC
there is a tons of files released in /usr/bin/*.py has /usr/bin/python(or /usr/bin/python2) shebang as the script interpreter that was indicate to python2, Leap 15.5 stopped to ship python2 entirely then it end up to an installation error when installing the john package: nothing provides /usr/bin/python, we need to change it to use python3(/usr/bin/python3) as the script interpreter, and might need to converting these python files to python3 if code isn't python3 supported.
Comment 2 Matej Cepl 2023-05-08 19:42:59 UTC
First of all, to the whole bug: absolutely not. I won’t take the responsibility for all customers’ scripts which will get broken, because they are actually not py3k compatible. If a customer is persuaded that they are, there is nothing wrong with them making /usr/bin/python3 -> /usr/local/bin/python link (please, not /usr/bin/python, so it doesn’t conflict with our packaging). However, then it is their responsibility and they would be breaking their systems.

Second, to the submit request: please, do not let shebang with /usr/bin/env be in any package in our distributions. If you are fixing shebangs (which is probably the only thing we can do) than change it into /usr/bin/python3, please.
Comment 3 Bernhard Wiedemann 2023-05-09 09:24:18 UTC
The shebang is already fixed in john.spec with

sed -i 's|#!%{_bindir}/env python|#!%{_bindir}/python|' run/*.py
sed -i 's|#! %{_bindir}/env python|#!%{_bindir}/python|' run/*.py