On Sep 18, 2010, at 12:52 PM, Avik Basu wrote:
>
> Line 219 of gluon/compileapp.py is as you described it. I also deleted
> the whole gluon directory and downloaded the latest source of web2py
> before restarting the server. Also, as far as I can tell, I am not
> doing anything tricky with Globals or the URL symbol in my models.
>
> I now get the following syntax error:
>
> SyntaxError: URL: a=index c=None f=None r=None u=URL
Thanks.
I realized after I sent that last request that the __name__ of URL might not be
significant at this point, because we're inside the URL() function.
This might be worth a try. In appadmin.py, near the beginning (after the
imports, but before response.menu is set):
logger = logging.getLogger('web2py')
logger.warning('appadmin url.name=%s' % URL.__name__)
What you *should* see is _URL. That's what I see if I stick it in my own
appadmin.
>
>
>
>
> On Sep 18, 3:33 pm, Jonathan Lundell <[email protected]> wrote:
>> On Sep 18, 2010, at 11:52 AM, Avik Basu wrote:
>>
>>
>>
>>> After restarting the server, I get the following error:
>>
>>> SyntaxError: URL: a=index c=None f=None r=None
>>
>> I was afraid of that, and I can't explain it.
>>
>> Please check that line 219 of gluon/compileapp.py is:
>>
>> environment['URL'] = html._gURL(request)
>>
>> And you might want to quit your server, delete all the .pyc files in gluon,
>> and restart.
>>
>> Do you do anything tricky with globals() or the URL symbol in your models?
>>
>> And let's try one more printing attempt:
>>
>> if not (application and controller and function):
>> if r:
>> msg = 'URL: a=%s c=%s f=%s r.a=%s r.c=%s r.f=%s' %
>> (application,controller,function,r.application,r.controller,r.function)
>> else:
>> msg = 'URL: a=%s c=%s f=%s r=%s u=%s' %
>> (application,controller,function,r,URL.__name__)
>> raise SyntaxError, msg
>>
>>
>>
>>
>>
>>> On Sep 18, 2:46 pm, Jonathan Lundell <[email protected]> wrote:
>>>> On Sep 18, 2010, at 11:40 AM, Avik Basu wrote:
>>
>>>>> When I replace the code in gluon/html.py, I still keep getting the
>>>>> same SyntaxError ('not enough information to build the url') which
>>>>> seems strange since that is not even in the code anymore.
>>
>>>>> I am sort of new to debugging the gluon code so I maybe making some
>>>>> simple mistake. I did delete the html.pyc file. Do I need to restart
>>>>> the server?
>>
>>>> I would assume so, given the message, and especially if you're not seeing
>>>> html.pyc getting recreated.
>>
>>>>> On Sep 18, 2:31 pm, Jonathan Lundell <[email protected]> wrote:
>>>>>> On Sep 18, 2010, at 9:46 AM, Avik Basu wrote:
>>
>>>>>>> Sure, I'm happy to help debug. Send me the print statements when you
>>>>>>> get a chance.
>>
>>>>>> FWIW, I just did the same thing (move the current appadmin into my own
>>>>>> app) and it seems to work OK; at least I can access appadmin/index OK.