You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the shell or scheduler are being run, these two request attributes are set, but not to the correct value (which should be False rather than None). And when the shell or scheduler are being run, these two attributes are not set at all (which results in None being returned). So, as it stands, request.is_shell and request.is_scheduler always return None.
The problem is that these attributes are set in gluon.main.wsgibase, which is only called for HTTP requests, but not when the shell or a scheduler task are being run.
When the shell or scheduler are being run, these two request attributes are set, but not to the correct value (which should be False rather than None). And when the shell or scheduler are being run, these two attributes are not set at all (which results in None being returned). So, as it stands, request.is_shell and request.is_scheduler always return None.
The problem is that these attributes are set in gluon.main.wsgibase, which is only called for HTTP requests, but not when the shell or a scheduler task are being run.
Fix:
In gluon.main.wsgibase at https://github.com/web2py/web2py/blob/master/gluon/main.py#L373:
Actually, in wsgibase, I think these would always be False, so maybe just set each to False.
In gluon.shell.env at https://github.com/web2py/web2py/blob/master/gluon/shell.py#L131, add:
The text was updated successfully, but these errors were encountered: