Submitted by Gerard on Sun, 03/20/2016 - 17:35
On two servers I get this error
File "/usr/libexec/webmin/webmin/acme_tiny.py", line 31
pub_exp = "0{0}".format(pub_exp) if len(pub_exp) % 2 else pub_exp
^
SyntaxError: invalid syntax
Status:
Closed (fixed)
Comments
Submitted by JamieCameron on Sun, 03/20/2016 - 19:08 Comment #1
Which Python version do you have installed on that system? You can check by running
rpm -q python
EPEL has newer Python versions available, if a newer version is needed. Jamie, do you know what the minimum Python version we need for the new client is?
Submitted by Gerard on Mon, 03/21/2016 - 04:41 Comment #3
I have python 2.4.3-56.el5 It is possible to install 2.6.8 alongside. Replacing the old version would break yum as I understand.
I have 2.6.8 installed but when working with the letsencrypt script it doesn't follow a symlink to the newer python.
Submitted by JamieCameron on Mon, 03/21/2016 - 22:52 Comment #4
You need version 2.6 installed, and make sure that the
python
command that appears first in Webmin's search path (set at Webmin Configuration -> Operating System and Environment).Submitted by caleidoskope on Tue, 04/05/2016 - 12:31 Pro Licensee Comment #5
How would you recommend to install python 2.6 alongside? I did a quick
yum --enablerepo=epel search python26-devel
and saw that packages for 2.6 are available================================= Matched: python26-devel ==================================
python26-devel.i386 : The libraries and header files needed for Python development
python26-devel.x86_64 : The libraries and header files needed for Python development
But I don't want to break python 2.4 for yum and other system components on centos5
Is it safe to use the epel repo or would you recommend something else?
Submitted by andreychek on Tue, 04/05/2016 - 12:43 Comment #6
We unfortunately haven't done much testing with CentOS 5 and alternate repositories. I'm not sure what impact it would make to install python26 on there.
However, EPEL is usually very good at not breaking things.
Do you happen to have a test server available, running CentOS 5? If so, you may want to try installing it there first though, just to make sure you don't see any problems afterwards.
Submitted by geocrasher on Sat, 04/23/2016 - 15:20 Comment #7
I tried several things to resolve this on CentOS 5, but finally had to resort to some script editing. No matter what I did, I could not get Virtualmin to run acme_tiny.py with the EPEL version of Python 2.6 that is installed in /usr/bin/python26. You also need the python26-argparse module.
Finally I did some grepping and edited the file /usr/libexec/webmin/webmin/letsencrypt-lib.pl on line 118. I changed this:
To this:
That actually worked (appended 26 to $python instead of reading it as $python26) and I was able to move on with my life! I hope this helps someone else :)
(edit: I wrote up a step-by-step on my blog here: https://www.tidbitsfortechs.com/2016/04/virtualmin-letsencrypt-module-centos-5-broken-quick-easy-fix/ )
Submitted by JamieCameron on Sat, 04/23/2016 - 17:07 Comment #8
Thanks for the suggestion - the next Webmin release will fix this by preferring the command
python27
orpython2.7
if installed, over the defaultpython
command.Can you confirm that it also worked properly for you with Python 2.6?
Submitted by geocrasher on Sat, 04/23/2016 - 18:01 Comment #9
Hi Jamie,
Yes, it worked fine with 2.6. The module did its job and I was able to install the resulting certificate without issue. As far as I know, there is no Python 2.7 for CentOS 5- so support for /usr/bin/python26 would be good to add in. Then again, anyone running CentOS 5 should be looking at upgrading to CentOS 7. My customer simply hasn't done it yet, so we have to make do :)
Submitted by JamieCameron on Sun, 04/24/2016 - 11:59 Comment #10
Ok, the next Webmin release will use the
python26
orpython2.6
command if installed, before falling back to thepython
command.Submitted by JamieCameron on Sun, 04/24/2016 - 11:59 Comment #11
Submitted by caleidoskope on Wed, 06/08/2016 - 11:33 Pro Licensee Comment #13
It is working fine on CentOS Linux 5.11, Webmin 1.801, Virtualmin 5.03 Pro with python26 installed as suggested by geocrasher. Thank's a lot guys!