External Method limits
Hi: I am working through the section of the Zope Book on External Methods (chapter 8: Advanced Zope Scripting -- http://www.zope.org/Members/michel/ZB/ScriptingZope.dtml -- Secton: Using External Methods) There is an example there which uses PIL that I am having some trouble with. Whenever I try to use makeThumbnail on a file which is more than about 60K I get the following error: Error Type: TypeError Error Value: expected string, ImplicitAcquirerWrapper found with this traceback: Traceback (innermost last): File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/www/Zope/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/www/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: makeThumbnail) File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: makeThumbnail) File /usr/local/www/Zope/lib/python/Products/ExternalMethod/ExternalMethod.py, line 262, in __call__ (Object: makeThumbnail) (Info: ((<Folder instance at 8a4cf00>, '002_2.JPG', 128), {}, (128,))) File /usr/local/www/Zope/Extensions/Thumbnail.py, line 18, in makeThumbnail (Object: Traversable) TypeError: (see above) My sense is that I am either running in to limitations on how much processing an External Method is allowed to perform (which I do not believe) or else the cStringIO module uses a different approach with files of a certain size and PIL does not like it. Any wisdom? _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
The code in the book is incorrect. Its expecting a string but getting an object instead. Cheers. -- Andy McKay. ----- Original Message ----- From: "Lee Harr" <missive@hotmail.com> To: <Zope@zope.org> Sent: Wednesday, July 11, 2001 6:39 AM Subject: [Zope] External Method limits
Hi:
I am working through the section of the Zope Book on External Methods (chapter 8: Advanced Zope Scripting -- http://www.zope.org/Members/michel/ZB/ScriptingZope.dtml -- Secton: Using External Methods)
There is an example there which uses PIL that I am having some trouble with. Whenever I try to use makeThumbnail on a file which is more than about 60K I get the following error:
Error Type: TypeError Error Value: expected string, ImplicitAcquirerWrapper found
with this traceback:
Traceback (innermost last): File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/www/Zope/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/www/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: makeThumbnail) File /usr/local/www/Zope/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: makeThumbnail) File /usr/local/www/Zope/lib/python/Products/ExternalMethod/ExternalMethod.py, line 262, in __call__ (Object: makeThumbnail) (Info: ((<Folder instance at 8a4cf00>, '002_2.JPG', 128), {}, (128,))) File /usr/local/www/Zope/Extensions/Thumbnail.py, line 18, in makeThumbnail (Object: Traversable) TypeError: (see above)
My sense is that I am either running in to limitations on how much processing an External Method is allowed to perform (which I do not believe) or else the cStringIO module uses a different approach with files of a certain size and PIL does not like it.
Any wisdom?
_________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi. :) I'm new on the list and a new user of Zope. Yay. :) Okay, I'm a designer, really, but I'll be damned if this isn't the best thing I've seen online in many a year (and I *have* been on since 1991...and even before so... :) )... Anyway, I'm not a coder so you guys are gonna get a lot of questions from me, if that's okay. I'm trying to do this all by myself (no coders here where I work...I'm it). First question: Inheritance. I'm doing the tutorial in the Zope Book that I downloaded a few weeks ago and printed out. It's the ZopeZoo site that I'm creating right now. For some reason, my standard_html_header is not functioning the way it is supposed to. When you go down into the Reptiles folder layer, the standard_html_header is not being read. It is apparently looking for the one in the root folder instead of the ZopeZoo folder (which is right above the layer of the Reptiles folder). You know the one I mean? The header that they have you create with the navigation system on it. It works for ZopeZoo/index_html but not ZopeZoo/Reptiles/index_html. Can anyone help me on this, please? :) Thank you. Oh..and this is my work email. I'm learning Zope both for personal reasons and for work...so I'm signed up to the list twice with different emails. Thanks again! Nat. :)
Welcome! Nat Harari writes:
First question: Inheritance.
I'm doing the tutorial in the Zope Book that I downloaded a few weeks ago and printed out. It's the ZopeZoo site that I'm creating right now. For some reason, my standard_html_header is not functioning the way it is supposed to. When you go down into the Reptiles folder layer, the standard_html_header is not being read. It is apparently looking for the one in the root folder instead of the ZopeZoo folder (which is right above the layer of the Reptiles folder). You know the one I mean? The header that they have you create with the navigation system on it. It works for ZopeZoo/index_html but not ZopeZoo/Reptiles/index_html. That's probably an instance of
"Containment before Context" a property of Acquisition that confuses many of its users. You may look at URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html to find out more. Probably, you will also find something in the "Zope Developer Guide". Dieter
Lee Harr writes:
I am working through the section of the Zope Book on External Methods (chapter 8: Advanced Zope Scripting -- http://www.zope.org/Members/michel/ZB/ScriptingZope.dtml -- Secton: Using External Methods)
There is an example there which uses PIL that I am having some trouble with. Whenever I try to use makeThumbnail on a file which is more than about 60K I get the following error:
Error Type: TypeError Error Value: expected string, ImplicitAcquirerWrapper found ... File /usr/local/www/Zope/Extensions/Thumbnail.py, line 18, in makeThumbnail (Object: Traversable) TypeError: (see above) Seems you use "file.data".
This is a string for small file sizes but an object for large ones. Use "str(file.data)", instead. Dieter
participants (4)
-
Andy McKay -
Dieter Maurer -
Lee Harr -
Nat Harari