squid-deb-proxy is a python2 script

Bug #1831306 reported by Rolf Leggewie
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
squid-deb-proxy (Ubuntu)
Fix Released
Low
Unassigned
Bionic
Invalid
Low
Unassigned

Bug Description

[ IMPACT ]

squid-deb-proxy is a python2 script. I suggest to change the shebang to /usr/bin/python2 to reflect this. The script crashes for users who have made python3 the default in bionic. Anyone with python as python2 is fine (the default), but someone who likes to stay in bionic LTS yet program in python3 this results in an avoidable and easily fixable problem.

[ TEST CASE ]

Compare "python2 /usr/share/squid-deb-proxy-client/apt-avahi-discover" vs. "python3 /usr/share/squid-deb-proxy-client/apt-avahi-discover".

[ REGRESSION POTENTIAL ]

There should not be (m)any. It just makes the implicit assumption that the script runs via python2 explicit.

The only time there could potentially be an issue is if python2 has been explicitly removed AND python pointed to python3. I have a hard time thinking why somebody would do that and such a setup would certainly break in a number of other situations.

Tags: bionic patch
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Which script do you mean, exactly? And on which ubuntu release?

/usr/share/squid-deb-proxy-client/apt-avahi-discover perhaps?

Changed in squid-deb-proxy (Ubuntu):
status: New → Incomplete
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

root@bionic-squid-deb-proxy-py2:~# /usr/share/squid-deb-proxy-client/apt-avahi-discover
http://10.0.100.136:8000/

root@bionic-squid-deb-proxy-py2:~# python3 /usr/share/squid-deb-proxy-client/apt-avahi-discover
  File "/usr/share/squid-deb-proxy-client/apt-avahi-discover", line 130
    print "http://[%s]:%s/" % (ip, port)
                          ^
SyntaxError: invalid syntax

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Is the above what you meant?

Revision history for this message
Rolf Leggewie (r0lf) wrote :

My apologies for the terrible description.

Your attempt to run /usr/share/squid-deb-proxy-client/apt-avahi-discover through python3 on bionic will run into problems. There are many other cases like this on bionic if you switch to python3 as default.

tags: added: bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for squid-deb-proxy (Ubuntu) because there has been no activity for 60 days.]

Changed in squid-deb-proxy (Ubuntu):
status: Incomplete → Expired
Rolf Leggewie (r0lf)
Changed in squid-deb-proxy (Ubuntu):
status: Expired → New
Revision history for this message
Rolf Leggewie (r0lf) wrote :
Changed in squid-deb-proxy (Ubuntu):
status: New → Fix Released
Revision history for this message
Rolf Leggewie (r0lf) wrote :

reopening to get a fix in to bionic

Changed in squid-deb-proxy (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Rolf Leggewie (r0lf) wrote :
Mathew Hodson (mhodson)
Changed in squid-deb-proxy (Ubuntu):
importance: Undecided → Low
Changed in squid-deb-proxy (Ubuntu Bionic):
importance: Undecided → Low
Changed in squid-deb-proxy (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Julian Andres Klode (juliank) wrote :

The real problem here is missing a python dependency in the package for bionic. In bionic, /usr/bin/python always points to /usr/bin/python2, both are installed by python-minimal; it's only in focal that we have python-is-python{2,3} packages allowing to choose.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Julian, thank you for your comment. I'm not sure I follow you.

https://packages.ubuntu.com/bionic/squid-deb-proxy-client certainly has a dependency declared on python. And while the default in bionic is for python to be python2, is there a reason not to try and make the experience better for those that want an LTS but program in python3 (I belong to that camp)? I see very little downside and if this had been published two years earlier we could have made life different for a good number of people.

description: updated
Rolf Leggewie (r0lf)
description: updated
description: updated
Changed in squid-deb-proxy (Ubuntu Bionic):
status: New → Incomplete
status: Incomplete → Opinion
status: Opinion → Invalid
Revision history for this message
Rolf Leggewie (r0lf) wrote :
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.