On Jan 28, 2012, at 7:31 PM, Ross Peoples wrote:

> I pulled from trunk a week or so ago and ever since, I've been getting this 
> every few minutes printed to the console:
> 
> WARNING:web2py.cron:WEB2PY CRON Call returned code 2:
> -J is reserved for Jython
> usage: /usr/bin/python [option] ... [-c cmd | -m mod | file | -] [arg] ...
> Try `python -h' for more information.
> 
> I am running web2py using this: python web2py.py -a password -i 0.0.0.0
> 
> If I add -N, the error goes away. I'm not using cron or anything. I only have 
> one app in this web2py instance. Anyone else noticing these errors?

The problem seems to be that when we issue a command like this (which the 
newcron does):

python web2py.py ... -J ...

...the -J is interpreted as an argument to python rather than to web2py.py.

I believe this can be fixed by adding a line in newcron.py. Change:

            w2p_path = fileutils.abspath('web2py.py', gluon=True)
            if os.path.exists(w2p_path):
                commands.append(w2p_path)

to

            w2p_path = fileutils.abspath('web2py.py', gluon=True)
            if os.path.exists(w2p_path):
                commands.append(w2p_path)
            commands.append('--')

(BTW, the os.path.exists logic seems broken. If the path doesn't exist, it 
doesn't make sense to continue at all.)


Reply via email to