Re: [Zope-dev] Re: Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-07 Thread Dieter Maurer
Christian Heimes wrote at 2004-2-6 23:01 +0100:
And the next one:

Python2.3.3/Zope2.70rc2/Plone2rc5.

Exception Type
AttributeError
Exception Value
'str' object has no attribute 'RESPONSE'

[...]
Module Products.CMFPhoto.Photo, line 510, in clearCache
AttributeError: 'str' object has no attribute 'RESPONSE'

The relevant code line is self.REQUEST.RESPONSE.setHeader(). The error
occured at object creation.

Something really bad is going on!

This may indeed be a memory corruption problem where
the same object is released/freed twice.

A long time ago, I used purify to analyse such problems.
It may no longer be feasible as Python now uses its own
memory management on top of the standard one.

It may be possible to compile Python in a way that it checks
for badly used memory management functions.

-- 
Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-07 Thread Leonardo Rochael Almeida
On Fri, 2004-02-06 at 20:01, Christian Heimes wrote:
 Christian Heimes wrote:
 [...]
 
 And the next one:
 
 Python2.3.3/Zope2.70rc2/Plone2rc5.
 
 Exception Type
 AttributeError
 Exception Value
 'str' object has no attribute 'RESPONSE'
 
 [...]
 Module Products.CMFPhoto.Photo, line 510, in clearCache
 AttributeError: 'str' object has no attribute 'RESPONSE'

METOO!

I just got this error. I commented out line 510 and the code worked.

I was about to uncomment the code again to try and debug it. It happened
when I tried to upload a .jpg thru webdav (konqueror webdav support) to
a CMFPhotoAlbum (0.4final) inside a plone2rc5 instance (Zope 2.6.4rc2,
Python 2.3.3).

I'm curious to at least know what kind of string 'self.REQUEST' is :-)

Want to coordinate? I'm happy to be the guinnea pig for this bug.


-- 
Leonardo Rochael Almeida [EMAIL PROTECTED]

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-07 Thread Chris McDonough
FWIW, this often happens when self isn't ultimately wrapped in a
RequestContainer (as it always should be when dealing with TTW code or
code that depends on REQUEST).  The string is likely something like
Special Object Used To Force Acqusition, which is the string that
represents something when it is declared as Acquisition.Acquired in a
class definition.

The trick is finding out where the thing loses its context.  No clue in
this case.

On Sat, 2004-02-07 at 18:51, Leonardo Rochael Almeida wrote:
 On Fri, 2004-02-06 at 20:01, Christian Heimes wrote:
  Christian Heimes wrote:
  [...]
  
  And the next one:
  
  Python2.3.3/Zope2.70rc2/Plone2rc5.
  
  Exception Type
  AttributeError
  Exception Value
  'str' object has no attribute 'RESPONSE'
  
  [...]
  Module Products.CMFPhoto.Photo, line 510, in clearCache
  AttributeError: 'str' object has no attribute 'RESPONSE'
 
 METOO!
 
 I just got this error. I commented out line 510 and the code worked.
 
 I was about to uncomment the code again to try and debug it. It happened
 when I tried to upload a .jpg thru webdav (konqueror webdav support) to
 a CMFPhotoAlbum (0.4final) inside a plone2rc5 instance (Zope 2.6.4rc2,
 Python 2.3.3).
 
 I'm curious to at least know what kind of string 'self.REQUEST' is :-)
 
 Want to coordinate? I'm happy to be the guinnea pig for this bug.
 


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-07 Thread Christian Heimes
Chris McDonough wrote:
 FWIW, this often happens when self isn't ultimately wrapped in a
 RequestContainer (as it always should be when dealing with TTW code or
 code that depends on REQUEST).  The string is likely something like
 Special Object Used To Force Acqusition, which is the string that
 represents something when it is declared as Acquisition.Acquired in a
 class definition.

 The trick is finding out where the thing loses its context.  No clue in
 this case.
If it's Special Object Used To Force Acqusition then it's (maybe) 
partly my fault. type(self.REQUEST) is Special Object Used To Force 
Acqusition when the object hasn't a real acquisition context. That's 
for example when we are still in the __init__() part of object creation.

I was pretty shure that upload_data is called in an acquisition context. 
It seems that it isn't called in a context under *every* circumstances.

Chris - was tricked again - ti(r)an

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-07 Thread Leonardo Rochael Almeida
On Sat, 2004-02-07 at 22:47, Christian Heimes wrote:
 Chris McDonough wrote:
   FWIW, this often happens when self isn't ultimately wrapped in a
   RequestContainer (as it always should be when dealing with TTW code or
   code that depends on REQUEST).  The string is likely something like
   Special Object Used To Force Acqusition, which is the string that
   represents something when it is declared as Acquisition.Acquired in a
   class definition.
  
   The trick is finding out where the thing loses its context.  No clue in
   this case.
 
 If it's Special Object Used To Force Acqusition then it's (maybe) 
 partly my fault.

That's it alright,

 type(self.REQUEST) is Special Object Used To Force 
 Acqusition when the object hasn't a real acquisition context. That's 
 for example when we are still in the __init__() part of object creation.

That's it alright :-)

 I was pretty shure that upload_data is called in an acquisition context. 
 It seems that it isn't called in a context under *every* circumstances.

In this case it's being callet by Photo.__init__ - OFS.Image.__init__ - 
Photo.update_data

Here's the traceback:

Traceback (innermost last):
  File /opt/zope/sw/Zope-264rc2/lib/python/ZPublisher/Publish.py, line 98, in publish
  File /opt/zope/sw/Zope-264rc2/lib/python/ZPublisher/mapply.py, line 88, in mapply
(Object: PUT)
  File /opt/zope/sw/Zope-264rc2/lib/python/ZPublisher/Publish.py, line 39, in 
call_object
(Object: PUT)
  File /opt/zope/sw/Zope-264rc2/lib/python/webdav/NullResource.py, line 108, in PUT
(Object: dcp_0996.jpg)
  File /home/leo/zopes/lra.com.br/Products/CMFPhotoAlbum/PhotoAlbum.py, line 69, in 
PUT_factory
(Object: unisa-congresso-brooklin)
  File /home/leo/zopes/lra.com.br/Products/CMFCore/PortalFolder.py, line 361, in 
invokeFactory
(Object: unisa-congresso-brooklin)
  File /home/leo/zopes/lra.com.br/Products/CMFCore/TypesTool.py, line 709, in 
constructContent
(Object: portal_types)
  File /home/leo/zopes/lra.com.br/Products/CMFCore/TypesTool.py, line 398, in 
constructInstance
(Object: Photo)
  File /home/leo/zopes/lra.com.br/Products/CMFPhoto/Photo.py, line 110, in addPhoto
(Object: unisa-congresso-brooklin)
  File /home/leo/zopes/lra.com.br/Products/CMFPhoto/Photo.py, line 174, in __init__
(Object: dcp_0996.jpg)
  File /home/leo/zopes/lra.com.br/Products/CMFDefault/Image.py, line 147, in __init__
(Object: dcp_0996.jpg)
  File /opt/zope/sw/Zope-264rc2/lib/python/OFS/Image.py, line 124, in __init__
(Object: dcp_0996.jpg)
  File /home/leo/zopes/lra.com.br/Products/CMFPhoto/Photo.py, line 400, in update_data
(Object: dcp_0996.jpg)
  File /home/leo/zopes/lra.com.br/Products/CMFPhoto/Photo.py, line 510, in clearCache
(Object: dcp_0996.jpg)
AttributeError: 'str' object has no attribute 'RESPONSE'


Cheers, Leo


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-06 Thread Christian Heimes
Christian Heimes wrote:
[...]
And the next one:

Python2.3.3/Zope2.70rc2/Plone2rc5.

Exception Type
AttributeError
Exception Value
'str' object has no attribute 'RESPONSE'
[...]
Module Products.CMFPhoto.Photo, line 510, in clearCache
AttributeError: 'str' object has no attribute 'RESPONSE'
The relevant code line is self.REQUEST.RESPONSE.setHeader(). The error
occured at object creation.
Something really bad is going on!

Christian

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-05 Thread Christian Heimes
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dieter Maurer wrote:
~  Looks like RESPONSE is None.
|
| I do not see how this can happen...
aol / but a CMFPhoto user reported a bug like this to me today.
According to his traceback self.REQUEST had now attribute RESPONSE.
That's really strange. :(
Time 2004/02/05 07:16:58.953 US/Pacific
User Name (User Id) admin (admin)
Request URL
http://www.stewardville.com/photos/createObject
Exception Type AttributeError
Exception Value RESPONSE
Traceback (innermost last):

Module ZPublisher.Publish, line 98, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 39, in call_object
Module
Products.CMFFormController.FSControllerPythonScript,
line 87, in __call__
Module Products.CMFFormController.Script, line 127, in
__call__
Module Products.CMFCore.FSPythonScript, line 104, in
__call__
Module Shared.DC.Scripts.Bindings, line 306, in
__call__
Module Shared.DC.Scripts.Bindings, line 343, in
_bindAndExec
Module Products.CMFCore.FSPythonScript, line 160, in
_exec
Module None, line 16, in createObject
FSControllerPythonScript at
/stewardville/createObject used for
/stewardville/photos
Line 16
Module Products.CMFPlone.PloneFolder, line 373, in
invokeFactory
Module Products.CMFCore.TypesTool, line 709, in
constructContent
Module Products.CMFCore.TypesTool, line 398, in
constructInstance
Module Products.CMFPhoto.Photo, line 110, in addPhoto
Module Products.CMFPhoto.Photo, line 174, in __init__
Module Products.CMFDefault.Image, line 147, in
__init__
Module OFS.Image, line 124, in __init__
Module Products.CMFPhoto.Photo, line 400, in
update_data
Module Products.CMFPhoto.Photo, line 510, in
clearCache
AttributeError: RESPONSE
Used versions: Zope 2.6.4, Python 2.1.3, CMF
1.4.2, PIL 1.1.4, Plone 2.0-RC3.
Christian / Tiran
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org
iD8DBQFAIwAe9aLWrfOU0PgRAsKmAJ9tJiInLW1lCV1X7f8giidCoydKOgCfUP8e
ECBEAOJwkDuuTfBJx/xfsSM=
=4jZP
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )