[Zope] System Error from Zope Book Example

Dan Shafer dan@gui.com
Sat, 16 Feb 2002 20:36:02 -0800


On page 157 of the Zope Book is an example of using an external 
Python script to create thumbnails of graphic images. The main 
makeThumbnail script works fine. Creating the Python script 
makeThumbnails and running it generates a System Error "bad argument 
to internal function." Here's the script I've written, which I am 
pretty sure matches the one in the book:

for image in context.objectValues('Image'):
     if not image.hasProperty('original_id'):
         context.makeThumbnail(image.getId())

Here's the dump portion of the error message page:. I'd appreciate 
any input you have for me. I'm completely bewildered.

Traceback (innermost last):
   File /home/dshafer/Zope-2.3.3-src/lib/python/ZPublisher/Publish.py, 
line 223, in publish_module
   File /home/dshafer/Zope-2.3.3-src/lib/python/ZPublisher/Publish.py, 
line 187, in publish
   File /home/dshafer/Zope-2.3.3-src/lib/python/Zope/__init__.py, line 
221, in zpublisher_exception_hook
     (Object: Traversable)
   File /home/dshafer/Zope-2.3.3-src/lib/python/ZPublisher/Publish.py, 
line 171, in publish
   File /home/dshafer/Zope-2.3.3-src/lib/python/ZPublisher/mapply.py, 
line 160, in mapply
     (Object: makeThumbnails)
   File /home/dshafer/Zope-2.3.3-src/lib/python/ZPublisher/Publish.py, 
line 112, in call_object
     (Object: makeThumbnails)
   File 
/home/dshafer/Zope-2.3.3-src/lib/python/Shared/DC/Scripts/Bindings.py, 
line 324, in __call__
     (Object: makeThumbnails)
   File 
/home/dshafer/Zope-2.3.3-src/lib/python/Shared/DC/Scripts/Bindings.py, 
line 354, in _bindAndExec
     (Object: makeThumbnails)
   File 
/home/dshafer/Zope-2.3.3-src/lib/python/Products/PythonScripts/PythonScript.py, 
line 336, in _exec
     (Object: makeThumbnails)
     (Info: ({'script': <PythonScript instance at 8bb3a30>, 'context': 
<Folder instance at 89c6c20>, 'container': <Folder instance at 
89c6c20>, 'traverse_subpath': []}, (), {}, None))
   File Script (Python), line 4, in makeThumbnails
     (Object: ssdrawing.jpeg)
   File 
/home/dshafer/Zope-2.3.3-src/lib/python/Products/ExternalMethod/ExternalMethod.py, 
line 269, in __call__
     (Object: makeThumbnail)
     (Info: (('ssdrawing.jpeg',), {}, (128,)))
   File /home/dshafer/Zope-2.3.3-src/Extensions/Thumbnail.py, line 16, 
in makeThumbnail
     (Object: Traversable)
SystemError: (see above)

-- 
Dan Shafer, Personal Creativity Trainer and Consultant
Trained Hartman Value Profile Analyst
http://www.danshafer.com/valueprofile.html