[Zope] AttributeError: Can't Pin It Down!

Dieter Maurer dieter at handshake.de
Thu Aug 9 12:46:31 EDT 2007


tonylabarbara at aol.com wrote at 2007-7-23 08:47 -0400:
> ...
>Nothing in the error log about that :(

Almost not to believe...

Unless, it comes from an exception ignored by the "error_log" object.

>> > ...
>> >Module Products.PageTemplates.TALES, line 221, in evaluate
>> >URL: /example.com/eng/test
>> >Line 7, Column 0
>> >Expression: <PythonExpr request.contact_us_form.header()>
>> > ...
>> >Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
>> >__traceback_info__: request.contact_us_form.header() 
>> >
>> >Module Python expression "request.contact_us_form.header()", line 1, in 
>> <expression> 
>> >
>> >Module ZPublisher.HTTPRequest, line 1223, in __getattr__ 
>> 
>> You did it almost right. You forgot to include the
>> "Error Type" and "Error Value" information.
>
>
>
>
>Exception Type
>
>AttributeError
>
>
>
>Exception Value
>
>header

This exception information seems not to correspond to the traceback
you have posted.

If you look carefully at your traceback, then you see that
the exception comes from a "request.contact_us_form.header()" expression
which then calls the "__getattr__" of an "HTTPRequest" instance (which
almost surely is "request") -- and this "__getattr__" raises
an "AttributeError".

I do not see any reason why "contact_us_form" should call
"request"'s "__getattr__". Thus, I expect that the "AttributeError"
really comes from the "request.contact_us_form" access.

If you are sure that you see "Exception Value: header", then
the "contact_us_form" really behaves extremely strange....

> ...
>Well, frankly, I built this site a long time ago before PTs were in vogue and it worked just fine using DTML. I changed it to PT for you to throw and capture this error ;)

Then, your translation to PT went probably wrong.
Are you sure that you access your forms via "request" (which
would be "REQUEST" in DTML).



-- 
Dieter


More information about the Zope mailing list