After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771910 - Default python version 3, need to manually specify python2 after every update
Default python version 3, need to manually specify python2 after every update
Status: RESOLVED FIXED
Product: gnome-tweak-tool
Classification: Applications
Component: general
3.22.x
Other Linux
: Normal minor
: ---
Assigned To: GNOME Tweak Tool maintainer(s)
GNOME Tweak Tool maintainer(s)
: 766640 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-09-24 11:18 UTC by Chris Coutinho
Modified: 2017-06-07 01:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Changed the shebang to explicitly use python2 (964 bytes, patch)
2016-09-24 12:15 UTC, Chris Coutinho
rejected Details | Review
Explicitly call python2 on shebangs (2.60 KB, patch)
2017-05-30 12:48 UTC, Rui Matos
committed Details | Review

Description Chris Coutinho 2016-09-24 11:18:11 UTC
I have python 3 as my default python version, so when a program like gnome-tweak-tool expects python2 instead (although IMHO ambiguously with just 'python')  it gets messed up.

I propose that instead of '#!/usr/bin/env python', it should be '#!/usr/bin/env python2'.

I would issue a pull request, but I'm not sure how to do that.
Comment 1 Ernestas Kulik 2016-09-24 11:22:29 UTC
Hi, Chris,

You can just attach a patch here. There is a guide that should get you on the right track: https://wiki.gnome.org/Newcomers/CodeContributionWorkflow
Comment 2 Chris Coutinho 2016-09-24 12:15:05 UTC
Created attachment 336190 [details] [review]
Changed the shebang to explicitly use python2

Gnome-tweak-tool used the ambiguous shebang: #!/usr/bin/env python
Python3 is the default version on my system, and is referenced by this
rather ambiguous call to python2. Explicitly setting the shebang to
python2 fixes the problem

Fix. Pretty simple fix

Bugzilla link:
Comment 3 Chris Coutinho 2016-09-24 12:16:13 UTC
Ok I added the patch using the steps outlined in your link. It should be in the automatically generated attachment above. Let me know if there are any issues.
Comment 4 Jeremy Bicha 2017-05-27 13:30:35 UTC
I believe we'll fix this by switching gnome-tweak-tool to python3 instead.

*** This bug has been marked as a duplicate of bug 740219 ***
Comment 5 Michael Catanzaro 2017-05-30 02:31:23 UTC
The problem is apparently nobody knows how to fix bug #740219, but clearly it's wrong for a program to expect /usr/bin/python to be python2, and this fix is trivial. So I would push this in the meantime.
Comment 6 Jeremy Bicha 2017-05-30 02:52:25 UTC
Oops, I meant to mark this as a duplicate of bug 781321. I do expect that Tweak Tool 3.26 will use python3.

After looking at PEP-0394 again, it does look like it is correct to change the shebang to python2 for now.

https://www.python.org/dev/peps/pep-0394/
Comment 7 Rui Matos 2017-05-30 12:47:23 UTC
Review of attachment 336190 [details] [review]:

thanks for the patch, I'll push one that also changes the lid inhibitor
Comment 8 Rui Matos 2017-05-30 12:48:03 UTC
Created attachment 352868 [details] [review]
Explicitly call python2 on shebangs

We'll migrate to python3 soon but for now let's be explicit with the
python version we require since both 2 and 3 are now commonly
installed everywhere.
Comment 9 Rui Matos 2017-05-30 12:48:37 UTC
Attachment 352868 [details] pushed as 7a0d422 - Explicitly call python2 on shebangs
Comment 10 Jeremy Bicha 2017-06-07 01:41:27 UTC
*** Bug 766640 has been marked as a duplicate of this bug. ***