In admin/default, we have:

def compile_app():
    c = app_compile(request.args[0], request)
    if c:
        session.flash = T('application compiled')
    else:
        import traceback
        tb = traceback.format_exc()
        session.flash = DIV(T('Cannot compile: there are errors in your 
app:',CODE(tb)))    
    redirect(URL(r=request, f='site'))


It's calling this from gluon/admin:

def app_compile(app, request):
    """
    Compiles the application

    Parameters
    ----------
    app:
        application name
    request:
        the global request object
    """
    from compileapp import compile_application, remove_compiled_application
    folder = apath(app, request)
    try:
        compile_application(folder)
        return True
    except (Exception, RestrictedError):
        remove_compiled_application(folder)
        return False


However, CODE(tb) appears to be always empty. I believe that's because 
traceback.format_exc() expects to find a traceback buffer on the stack, but 
since app_compile() has returned after catching the exception, the exception 
isn't on the stack any more. I think it's necessary for app_compile to return 
the traceback to the caller.



-- 
Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en

Reply via email to