[Solved] FAHControl doesn't work on Fedora 31: needs Python2

Moderators: Site Moderators, FAHC Science Team

Post Reply
Markus_Laker
Posts: 20
Joined: Sun Dec 01, 2019 11:36 am

[Solved] FAHControl doesn't work on Fedora 31: needs Python2

Post by Markus_Laker »

If run from a desktop environment, FAHControl silently fails during startup. If run from a bash prompt, it fails more informatively:

Code: Select all

[msl@localhost ~]$ FAHControl 
  File "/usr/bin/FAHControl", line 57
    if sock.recv(1024).strip() == 'OK': print 'Ok'
                                                 ^
SyntaxError: invalid syntax
[msl@localhost ~]$
Python 2 and Python 3 are incompatible in several ways that are provoked by this script. Python 3 is the default Python in Fedora 31 -- that's what you get if you run /usr/bin/python. However, Python 2 is available as /usr/bin/python2 for backwards-compatibility. If I change the first line from

Code: Select all

#!/usr/bin/python
to

Code: Select all

#!/usr/bin/python2
then FAHControl starts normally.

A cleaner solution -- which is what I've actually done -- is to take a copy of FAHControl into a directory that's both under my home directory and on my path, and to modify the copy.

Perhaps the developers could modify the shebang line in the next release, so that this workaround isn't necessary?
Gleep
Posts: 13
Joined: Tue Dec 17, 2019 4:12 pm

Re: [Solved] FAHControl doesn't work on Fedora 31: needs Pyt

Post by Gleep »

Thanks for sharing the solution for this. I installed FAH on Fedora 31 this weekend and I was scratching my head on why FAHControl was failing to start, then spotted this post.
Post Reply