On Dec 22, 2010, at 7:55 AM, Bruno Rocha wrote:
> May be this line :
> if not request.env.web2py_runtime_gae:
>
>
> is missing in referred method.
>
>
> Can you try to change the method for test?
>
>
> IN main.py line 445
>
>
>
> def create_missing_folders():
> for path in ('applications', 'deposit', 'site-packages', 'logs'):
> path = abspath(path, gluon=True)
> if not os.path.exists(path):
> os.mkdir(path)
> paths = (global_settings.gluon_parent, abspath('site-packages',
> gluon=True), "")
> [add_path_first(path) for path in paths]
>
>
> should be:
>
>
> def create_missing_folders():
> if not request.env.web2py_runtime_gae
> :
> for path in ('applications', 'deposit', 'site-packages', 'logs'):
> path = abspath(path, gluon=True)
> if not os.path.exists(path):
> os.mkdir(path)
> paths = (global_settings.gluon_parent, abspath('site-packages',
> gluon=True), "")
> [add_path_first(path) for path in paths]
>
> I don't know if this is really a solution, but worth a try.
>
> I'll make some tests here too.
>
>
I think that's right, Bruno. The missing-folder logic got factored out, because
it wasn't being invoked for any server except Rocket, but it shouldn't run for
GAE. However, we still want the sys.path logic, so the fix should look more
like this:
def create_missing_folders():
if not request.env.web2py_runtime_gae:
for path in ('applications', 'deposit', 'site-packages', 'logs'):
path = abspath(path, gluon=True)
if not os.path.exists(path):
os.mkdir(path)
paths = (global_settings.gluon_parent, abspath('site-packages',
gluon=True), "")
[add_path_first(path) for path in paths]