[ZCM] [ZC] 1654/ 7 Comment "Getting "AttributeError: 'NoneType' object"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Tue Feb 22 07:52:28 EST 2005


Issue #1654 Update (Comment) "Getting "AttributeError: 'NoneType' object"
 Status Pending, Zope/bug medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/1654

==============================================================
= Comment - Entry #7 by BwanaZulia on Feb 22, 2005 7:52 am

One of my DTML Methods just had this problem as well. It was when I moved from Zope 2.7.0b4 -> 2.7.4 and only seemed to corrupt this one file.

Traceback (innermost last): 

Module ZPublisher.Publish, line 101, in publish 
Module ZPublisher.mapply, line 88, in mapply 
Module ZPublisher.Publish, line 39, in call_object 
Module Shared.DC.Scripts.Bindings, line 306, in __call__ 
Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec 
Module App.special_dtml, line 175, in _exec 
Module Shared.DC.Scripts.Bindings, line 320, in __render_with_namespace__ 
Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec 
Module App.special_dtml, line 175, in _exec 
Module DocumentTemplate.DT_Util, line 198, in eval
__traceback_info__: RESPONSE 
Module <string>, line 0, in ? 
AttributeError: 'NoneType' object has no attribute 'setHeader' 

I could open it through the external editor link and in that way was able to delete it and replace it with a new one with the same code. Seems to work fine now. Odd.

BZ
________________________________________
= Comment - Entry #6 by chrisw on Jan 20, 2005 4:55 am

So removing security assertions "solved" the problem?
That doesn't sound good ;-)

What's the example you're referring to?

Chris
________________________________________
= Comment - Entry #5 by chrisw on Jan 19, 2005 5:25 am

from Patrick:
This turned out to be security related - I was basing my  product on the example in the Zope Bible, and that apparently doesn't work under 2.7.  Once I deleted all security declarations from my product, it works (albeit without security.)

Sorry for the bad bug, although it might be helpful if the error messages could be more meaningful.  (I'm a newbie, so I have no idea how that could be made to happen.)

Thanks for looking at this,

Patrick 
________________________________________
= Comment - Entry #4 by chrisw on Jan 18, 2005 2:56 pm

I wonder if this is related?

http://mail.zope.org/pipermail/zope-pas/2004-November/000237.html

(Jens, care to comment?)
________________________________________
= Comment - Entry #3 by chrisw on Jan 18, 2005 10:49 am

Did this ever get solved?

I have an unreproducable but logged example of a call to /manage_page_style.css resulting in this...

Chris
________________________________________
= Comment - Entry #2 by efge on Jan 8, 2005 1:10 pm

Please provide the part of your code that refers to RESPONSE and setHeader.

________________________________________
= Request - Entry #1 by Anonymous User on Jan 7, 2005 1:45 pm

Asked about this on the zope email list, and was told I probably needed to file a bug report.  Will be happy to provide full source if that will help.

I'm getting the following errors in relation to a
product I'm building, and can't seem to figure out why.  It appears to
me that the dtml method is not getting a RESPONSE object, but I've no
idea what could cause that.  Any help would be GREATLY appreciated, as
I'm very new to zope and really can't seem to figure this out.

Thanks!

Patrick

============ Errors:

Site Error

An error was encountered while publishing this resource.

AttributeError
Sorry, a site error occurred.

Traceback (innermost last):

   * Module ZPublisher.Publish, line 175, in publish_module_standard
   * Module ZPublisher.Publish, line 132, in publish
   * Module Zope.App.startup, line 204, in zpublisher_exception_hook
   * Module ZPublisher.Publish, line 101, in publish
   * Module ZPublisher.mapply, line 88, in mapply
   * Module ZPublisher.Publish, line 39, in call_object
   * Module Shared.DC.Scripts.Bindings, line 306, in __call__
   * Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
   * Module App.special_dtml, line 175, in _exec
   * Module Shared.DC.Scripts.Bindings, line 320, in __render_with_namespace__
   * Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
   * Module App.special_dtml, line 175, in _exec
   * Module DocumentTemplate.DT_Util, line 198, in eval
     __traceback_info__: RESPONSE
   * Module <string>, line 0, in ?

AttributeError: 'NoneType' object has no attribute 'setHeader' (Also,
an error occurred while attempting to render the standard error
message.)

==========  Relevant Python Code:
   security.declareProtected('View management screens', 'manage_main')
   manage_main = DTMLFile("dtml/mainAnnounceIt", globals())

========== DTML Page (dtml/mainAnnounceIt)
<dtml-var manage_page_header>
<dtml-var manage_tabs>

<form method=post action=editAnnounceIt>
<table border=0 cellspacing=0 cellpadding=5>
<tr>
 <td>Title:</td>
 <td><input type=text name="title" value="&dtml-title;"></td>
</tr>
<tr>
 <td colspan=2><input type=submit value="Edit Annoucements"></td>
</tr>
</table>
</form>
</body>
</html>

<dtml-var manage_page_footer>
==============================================================



More information about the Zope-Collector-Monitor mailing list