Hello everyone,
I just migrated an old (2017-ish) web2py app, which was still hosted on a user machine, running on Rocket HTTP server.
The app is now on a CentOS 7 VM, under nginx/uwsgi using HTTPS.
Web2py version is 2.27.1, over Python 2.7.5, in a virtualenv.
All is OK as for the app itself, but now I as trying to setup cron to to delete old sessions, and I'm stuck with this :
$ python web2py.py -S <myapp> -M -R scripts/sessions2trash.py -A -o -X 3600 -f -v
Traceback (most recent call last):
File "web2py.py", line 44, in <module>
import gluon.widget
File "/home/apinho/web2py/web2py/gluon/widget.py", line 28, in <module>
from gluon.console import console, is_appdir
File "/home/apinho/web2py/web2py/gluon/console.py", line 53, in <module>
from gluon.shell import die
File "/home/apinho/web2py/web2py/gluon/shell.py", line 305
exec(read_pyc(pycfile), _env)
SyntaxError: unqualified exec is not allowed in function 'run' it contains a nested function with free variables
I really have no clue what to do. There is little help online. The only one I could find says that upgrading to Python 2.7.18 would do the trick, but that would most probably wreck Centos7 (Which I am stuck with, for it is my company's mandatory Linux distro for production environments).
Any help would be much appreciated.
Alexandre