[albatross-users] Problem with ctx.get_value

Andrew McNamara andrewm at object-craft.com.au
Wed Aug 17 16:24:53 EST 2005


>If someone enters a non-zero integer value with leading zeros, the page 
>throws an exception. This occurs in albatross 1.20, 1.30 and 1.32

I think things have gone wrong by line 113 of qaForms.py. What does the
"formfield" variable contain immediately prior to the exception?

>Here is a sample traceback:
>
>Traceback (most recent call last):
>  File "/big/dom/xquestadmin/cgi-dev/albatross/app.py", line 282, in run
>    self.process_request(ctx)
>  File "mgr.py", line 95, in process_request
>    return PageModuleMixin.process_request(self, ctx)
>  File "/big/dom/xquestadmin/cgi-dev/albatross/app.py", line 462, in process_request
>    func(ctx)
>  File "./pages/setquestion.py", line 158, in page_process
>    qaForms.checkform(ctx, formfields)
>  File "/big/dom/xquestadmin/cgi-dev/qaForms.py", line 511, in checkform
>    striptrailingspaces(ctx, formfields)
>  File "/big/dom/xquestadmin/cgi-dev/qaForms.py", line 113, in striptrailingspaces
>    fieldvalue = ctx.get_value(formfield)
>  File "/big/dom/xquestadmin/cgi-dev/albatross/context.py", line 452, in get_value
>    return self._get_value(name)
>  File "/big/dom/xquestadmin/cgi-dev/albatross/context.py", line 440, in _get_value
>    return eval(name, {}, self.locals.__dict__)
>  File "<string>", line 1
>    0238
>       ^
>SyntaxError: invalid token
-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/



More information about the Albatross-users mailing list